mirror of
https://github.com/corda/corda.git
synced 2025-06-14 05:08:18 +00:00
fix float to integer conversion
Java requires that NaNs be converted to zero and that numbers at or beyond the limits of integer representation be clamped to the largest or smallest value that can be represented, respectively.
This commit is contained in:
@ -14,6 +14,10 @@ public final class Float extends Number {
|
||||
public static final Class TYPE = Class.forCanonicalName("F");
|
||||
private static final int EXP_BIT_MASK = 0x7F800000;
|
||||
private static final int SIGNIF_BIT_MASK = 0x007FFFFF;
|
||||
|
||||
public static final float NEGATIVE_INFINITY = -1.0f / 0.0f;
|
||||
public static final float POSITIVE_INFINITY = 1.0f / 0.0f;
|
||||
public static final float NaN = 0.0f / 0.0f;
|
||||
|
||||
private final float value;
|
||||
|
||||
|
Reference in New Issue
Block a user