From 6f9a9fd15dcfba48578a54cd00a885f163d8a9cf Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 17 Oct 2013 15:45:14 -0500 Subject: [PATCH] Add java.lang.Double#doubleToLongBits It is different than #doubleToRawLongBits only when the input value is not a number. Signed-off-by: Johannes Schindelin --- classpath/java/lang/Double.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classpath/java/lang/Double.java b/classpath/java/lang/Double.java index e1fce9d645..2abe24b1d3 100644 --- a/classpath/java/lang/Double.java +++ b/classpath/java/lang/Double.java @@ -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);