From 579a0704cd902ac15223c7b6286e93eaf0902609 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Sat, 20 Jun 2009 08:50:33 +0000 Subject: [PATCH] use floatToRawIntBits and doubleToRawLongBits for encoding float values as normalization is not needed and much faster git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@786770 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/lucene/util/NumericUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/lucene/util/NumericUtils.java b/src/java/org/apache/lucene/util/NumericUtils.java index 65276261e7a..8620efa40e3 100644 --- a/src/java/org/apache/lucene/util/NumericUtils.java +++ b/src/java/org/apache/lucene/util/NumericUtils.java @@ -300,7 +300,7 @@ public final class NumericUtils { * @see #sortableLongToDouble */ public static long doubleToSortableLong(double val) { - long f = Double.doubleToLongBits(val); + long f = Double.doubleToRawLongBits(val); if (f<0) f ^= 0x7fffffffffffffffL; return f; } @@ -322,7 +322,7 @@ public final class NumericUtils { * @see #sortableIntToFloat */ public static int floatToSortableInt(float val) { - int f = Float.floatToIntBits(val); + int f = Float.floatToRawIntBits(val); if (f<0) f ^= 0x7fffffff; return f; }