FastDoubleMath with methods for
converting FloatingPointLiteral productions to floats.
See JavaDoubleParser for a description of
FloatingPointLiteral.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | FLOAT_EXPONENT_BIAS
Bias used in the exponent of a float. |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final float[] | FLOAT_POWER_OF_TEN
Precomputed powers of ten from 10^0 to 10^10. |
| private static final int | FLOAT_SIGNIFICAND_WIDTH
The number of bits in the significand, including the implicit bit. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static float | decFloatLiteralToFloat(boolean isNegative, long significand, int exponent, boolean isSignificandTruncated, int exponentOfTruncatedSignificand)
|
| pack-priv static float | hexFloatLiteralToFloat(boolean isNegative, long significand, int exponent, boolean isSignificandTruncated, int exponentOfTruncatedSignificand)
|
| pack-priv static float | Returns: the computed double on success,Double#NaN on failurewhether the number is negative isNegative, long uint64 the significand significand, int int32 the exponent of the number power)Attempts to compute digits * 10^(power) exactly; and if "negative" is true, negate the result. |
| FLOAT_EXPONENT_BIAS | back to summary |
|---|---|
| private static final int FLOAT_EXPONENT_BIAS Bias used in the exponent of a float. | |
| FLOAT_MAX_EXPONENT_POWER_OF_TEN | back to summary |
|---|---|
| private static final int FLOAT_MAX_EXPONENT_POWER_OF_TEN | |
| FLOAT_MAX_EXPONENT_POWER_OF_TWO | back to summary |
|---|---|
| private static final int FLOAT_MAX_EXPONENT_POWER_OF_TWO | |
| FLOAT_MIN_EXPONENT_POWER_OF_TEN | back to summary |
|---|---|
| private static final int FLOAT_MIN_EXPONENT_POWER_OF_TEN | |
| FLOAT_MIN_EXPONENT_POWER_OF_TWO | back to summary |
|---|---|
| private static final int FLOAT_MIN_EXPONENT_POWER_OF_TWO | |
| FLOAT_POWER_OF_TEN | back to summary |
|---|---|
| private static final float[] FLOAT_POWER_OF_TEN Precomputed powers of ten from 10^0 to 10^10. These can be represented exactly using the float type. | |
| FLOAT_SIGNIFICAND_WIDTH | back to summary |
|---|---|
| private static final int FLOAT_SIGNIFICAND_WIDTH The number of bits in the significand, including the implicit bit. | |
| FastFloatMath | back to summary |
|---|---|
| private FastFloatMath() Don't let anyone instantiate this class. | |
| decFloatLiteralToFloat | back to summary |
|---|---|
| pack-priv static float decFloatLiteralToFloat(boolean isNegative, long significand, int exponent, boolean isSignificandTruncated, int exponentOfTruncatedSignificand) | |
| hexFloatLiteralToFloat | back to summary |
|---|---|
| pack-priv static float hexFloatLiteralToFloat(boolean isNegative, long significand, int exponent, boolean isSignificandTruncated, int exponentOfTruncatedSignificand) | |
| tryDecToFloatWithFastAlgorithm | back to summary |
|---|---|
| pack-priv static float tryDecToFloatWithFastAlgorithm(boolean isNegative, long significand, int power) Attempts to compute digits * 10^(power) exactly; and if "negative" is true, negate the result. This function will only work in some cases, when it does not work it returns null. This should work *most of the time* (like 99% of the time). We assume that power is in the [-325, 308] interval: the caller is responsible for this check.
| |