lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r786770 - /lucene/java/trunk/src/java/org/apache/lucene/util/NumericUtils.java
Date Sat, 20 Jun 2009 08:50:33 GMT
Author: uschindler
Date: Sat Jun 20 08:50:33 2009
New Revision: 786770

URL: http://svn.apache.org/viewvc?rev=786770&view=rev
Log:
use floatToRawIntBits and doubleToRawLongBits for encoding float values as normalization is
not needed and much faster

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/util/NumericUtils.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/NumericUtils.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/NumericUtils.java?rev=786770&r1=786769&r2=786770&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/NumericUtils.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/NumericUtils.java Sat Jun 20 08:50:33
2009
@@ -300,7 +300,7 @@
    * @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 @@
    * @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;
   }



Mime
View raw message