Reals

Describes Real numbers

Real numbers are implemented as floating point numbers according to the IEEE 754 specification, which is the specification used by Java. All constants of type Real must include a period and they may have an exponential part denoted by 'e' or 'E'. They may also be denoted by the suffix 'f', 'F', 'd' or 'D'. The suffix is optional if the exponent is included.

Reals provide a fast and compact way of handling a very large range of values. However, they introduce rounding errors and are therefore not suitable when every digit, and particularly trailing digits, must be exact. This is a requirement when operating on monetary amounts, which should be stored as Decimals.

The following are all valid real constants:
Variables of type Real can be declared in one of two precisions, measured in bits of storage:
Precision Maximum Value Minimum Value
64 1.7976931348623157x10308 4.9x10-324
32 3.4028235x1038 1.4x10-45
The precision is specified in parenthesis after the data type, as follows:
x As Real(<precision>)
For example, if you wish to declare a 64-bit real, you would use:
x As Real(64)
Note: Only the two precision values shown in the table are supported.