Module Float


Constant DIGITS_10
Constant MIN_10_EXP
Constant MAX_10_EXP
Constant MIN
Constant MAX
Constant EPSILON

constant Float.DIGITS_10
constant Float.MIN_10_EXP
constant Float.MAX_10_EXP
constant Float.MIN
constant Float.MAX
constant Float.EPSILON

Description

These constants define the limits for floats on the current architecture:

DIGITS_10

The number of decimal digits that can be represented. Any number with this many decimal digits can be stored in a float and converted back to decimal form without change. DIGITS_10 is not less than 6.

MIN_10_EXP
MAX_10_EXP

Limits of the exponent in decimal base. 10 raised to any number within this range can be represented in normalized form. MIN_10_EXP is not greater than -37. MAX_10_EXP is not less than 37.

MIN

The smallest normalized float greater than zero. It's not greater than 1e-37.

MAX

The largest finite float. It's not less than 1e37.

EPSILON

The difference between 1 and the smallest value greater than 1 that can be represented. It's not greater than 1e-5.

Note

The size of the float type can be controlled when Pike is compiled with the configure flags --with-double-precision and --with-long-double-precision. The default is to use the longest available float type that fits inside a pointer.


Constant FLOAT_PRECISION
Constant DOUBLE_PRECISION
Constant LONG_DOUBLE_PRECISION

constant Float.FLOAT_PRECISION
constant Float.DOUBLE_PRECISION
constant Float.LONG_DOUBLE_PRECISION

Description

Tells which C compiler float type that is used for Pike floats. Only one of these constants will exist (with the value 1) at runtime.

FLOAT_PRECISION

The float type of the C compiler is used.

DOUBLE_PRECISION

The double type of the C compiler is used.

LONG_DOUBLE_PRECISION

The long double type of the C compiler is used.

Note

The float type can be controlled when Pike is compiled with the configure flags --with-double-precision and --with-long-double-precision. The default is to use the longest available float type that fits inside a pointer.