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
This commit is contained in:
Uwe Schindler 2009-06-20 08:50:33 +00:00
parent 65131ca7b9
commit 579a0704cd
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}