REAL

Click to skip syntax diagram

Numeric to Real

Read syntax diagramSkip visual syntax diagram>>-REAL--(--numeric-expression--)------------------------------><
 

String to Real

Read syntax diagramSkip visual syntax diagram>>-REAL--(--string-expression--)-------------------------------><
 

The REAL function returns a single-precision floating-point representation of:

Numeric to Real

numeric-expression
The argument is an expression that returns a value of any built-in numeric data type.

The result is the same number that would occur if the argument were assigned to a single-precision floating-point column or variable. If the numeric value of the argument is not within the range of single-precision floating-point, an error is returned.

String to Real

string-expression
An expression that returns a value that is a character-string or graphic-string representation of a number.

If the argument is a string-expression, the result is the same number that would result from CAST( string-expression AS REAL). Leading and trailing blanks are eliminated and the resulting string must conform to the rules for forming a floating-point, integer, or decimal constant. If the numeric value of the argument is not within the range of single-precision floating-point, an error is returned.

The single-byte character constant that must be used to delimit the decimal digits in string-expression from the whole part of the number is the default decimal point. For more information, see Decimal point.

The result of the function is a single-precision floating-point number. If the argument can be null, the result can be null; if the argument is null, the result is the null value.

Note

Syntax alternatives: The CAST specification should be used for maximal portability. For more information, see CAST specification.

Example