diff options
Diffstat (limited to 'luni/src/main/java/java/lang/Float.java')
-rw-r--r-- | luni/src/main/java/java/lang/Float.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/luni/src/main/java/java/lang/Float.java b/luni/src/main/java/java/lang/Float.java index 900b2a0..5f316f1 100644 --- a/luni/src/main/java/java/lang/Float.java +++ b/luni/src/main/java/java/lang/Float.java @@ -199,7 +199,13 @@ public final class Float extends Number implements Comparable<Float> { * float {@code value}. All <em>Not-a-Number (NaN)</em> values are converted to a single NaN * representation ({@code 0x7fc00000}) (compare to {@link #floatToRawIntBits}). */ - public static native int floatToIntBits(float value); + public static int floatToIntBits(float value) { + if (value != value) { + return 0x7fc00000; // NaN. + } else { + return floatToRawIntBits(value); + } + } /** * Returns an integer corresponding to the bits of the given |