Add java.lang.Double#doubleToLongBits

It is different than #doubleToRawLongBits only when the input value
is not a number.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2013-10-17 15:45:14 -05:00
parent a9ecf1eaed
commit 6f9a9fd15d

View File

@ -96,6 +96,11 @@ public final class Double extends Number {
}
}
public static long doubleToLongBits(double value) {
if (isNaN(value)) return 0x7ff8000000000000L;
return doubleToRawLongBits(value);
}
public static native int fillBufferWithDouble(double value, byte[] buffer,
int charCount);