Java Reference
In-Depth Information
Table A.3.1
Floating-Point Type Specifications
float-
extended-
exponent
double-
extended-
exponent
Parameter
float
double
N
24
24
53
53
K
8
> 10
11
> 14
E max
+127
> +1022
+1023
> +16382
E min
−126
< −1021
−1022
< −16381
NaN values are unordered. This means that:
Numerical comparisons and tests for numerical equality result in false if either or
both operands are NaN .
A test for numerical equality of a value against itself results in false if and only if
the value is NaN.
A test for numerical inequality results in true if either operand is NaN .
A.3.3 Extended exponents
The JVM Specifications after version 1.1 allow for a JVM implementation to
include extended exponent versions of either or both the float and double types
during intermediate calculations so as to avoid over/under flows.
Table A.3.1 maps the floating point specifications for the four types with the
symbols defined as follows:
N = number of bits in significand
K = number of bits in exponent
E max = maximum value of exponent
E min = minimum size of exponent
The final accessible floating-point results will be in float or double types
but intermediate floating-point values can use the larger extended exponent rep-
resentations if the platform processor allows it. There is no access for the Java
programmer to the extended exponent types.
The JVM does not support either the official IEEE 754 single extended or
double extended format since these extended formats require extended precision,
i.e. longer significand, in addition to the extended exponent ranges shown in the
above table. The documentation for a particular JVM should indicate whether it
uses the extended exponent options.
The modifier strictfp in front of a method will force the precision to
remain at 64-bit for all calculations within that method. This is useful if one
wants to ensure exactly the same results regardless of the platform or JVM
implementation.
Search WWH ::




Custom Search