FLOAT

The FLOAT function returns a result equal to Expression converted to single-precision floating-point. If Expression is a complex number, FLOAT returns the real part.

Calling Sequence

Result = FLOAT( Expression [, Offset [, Dim 1 , ..., Dim n ]] )

Arguments

Expression

The expression to be converted to single-precision floating-point.

Offset

Offset from beginning of the Expression data area. Specifying this argument allows fields of data extracted from Expression to be treated as single precision floating point data. See the description in Constants and Variables for details.

D i

When extracting fields of data, the D i arguments specify the dimensions of the result. The dimension parameters can be any scalar expression. Up to eight dimensions can be specified. If no dimension arguments are given, the result is taken to be scalar.

When converting from a string argument, it is possible that the string does not contain a valid floating-point value and no conversion is possible. The default action in such cases is to print a warning message and return 0. The ON_IOERROR procedure can be used to establish a statement to be jumped to in case of such errors.

Example

If A contains the integer value 6, it can be converted to floating-point and stored in the variable B by entering:

B = FLOAT(A)

See Also

BYTE , COMPLEX , DCOMPLEX , DOUBLE , FIX , LONG , STRING