single

Syntax single (value)

Params value is the object whose datatype you wish to coerce to singleType.

Action Coerces the datatype of value to be single-precision floating-point if possible.

Returns The coerced value if coercion is successful, otherwise, returns an error.

Examples single (32768)

   » 32768.0

single (2000000000)

   » 2000000000.0

single ("123.45")

   » 123.45

single (1)/3

   » 0.3333

single (infinity)

   » 3.40282E+38

Errors An attempt to coerce an inappropriate datatype to a single-precision floating-point number produces an error message.

Notes See the discussion of datatypes in Chapter 1 of the UserTalk Reference Guide for information on the range of values that can be represented by a single-precision floating-point number, and for other details.

Discuss