/** * Converts a sortable <code>int</code> back to a <code>float</code>. * @see #floatToSortableInt */ public static float sortableIntToFloat(int encoded) { return Float.intBitsToFloat(sortableFloatBits(encoded)); }
/** * Converts a <code>float</code> value to a sortable signed <code>int</code>. * The value is converted by getting their IEEE 754 floating-point "float format" * bit layout and then some bits are swapped, to be able to compare the result as int. * By this the precision is not reduced, but the value can easily used as an int. * The sort order (including {@link Float#NaN}) is defined by * {@link Float#compareTo}; {@code NaN} is greater than positive infinity. * @see #sortableIntToFloat */ public static int floatToSortableInt(float value) { return sortableFloatBits(Float.floatToIntBits(value)); }
@Override public long longValue() throws IOException { return NumericUtils.sortableFloatBits((int) in.longValue()); } };
/** * Converts a sortable <code>int</code> back to a <code>float</code>. * @see #floatToSortableInt */ public static float sortableIntToFloat(int encoded) { return Float.intBitsToFloat(sortableFloatBits(encoded)); }
/** * Converts a <code>float</code> value to a sortable signed <code>int</code>. * The value is converted by getting their IEEE 754 floating-point "float format" * bit layout and then some bits are swapped, to be able to compare the result as int. * By this the precision is not reduced, but the value can easily used as an int. * The sort order (including {@link Float#NaN}) is defined by * {@link Float#compareTo}; {@code NaN} is greater than positive infinity. * @see #sortableIntToFloat */ public static int floatToSortableInt(float val) { return sortableFloatBits(Float.floatToIntBits(val)); }
/** * Converts a <code>float</code> value to a sortable signed <code>int</code>. * The value is converted by getting their IEEE 754 floating-point "float format" * bit layout and then some bits are swapped, to be able to compare the result as int. * By this the precision is not reduced, but the value can easily used as an int. * The sort order (including {@link Float#NaN}) is defined by * {@link Float#compareTo}; {@code NaN} is greater than positive infinity. * @see #sortableIntToFloat */ public static int floatToSortableInt(float value) { return sortableFloatBits(Float.floatToIntBits(value)); }
/** * Converts a sortable <code>int</code> back to a <code>float</code>. * @see #floatToSortableInt */ public static float sortableIntToFloat(int val) { return Float.intBitsToFloat(sortableFloatBits(val)); }
/** * Converts a sortable <code>int</code> back to a <code>float</code>. * @see #floatToSortableInt */ public static float sortableIntToFloat(int val) { return Float.intBitsToFloat(sortableFloatBits(val)); }
/** * Converts a <code>float</code> value to a sortable signed <code>int</code>. * The value is converted by getting their IEEE 754 floating-point "float format" * bit layout and then some bits are swapped, to be able to compare the result as int. * By this the precision is not reduced, but the value can easily used as an int. * The sort order (including {@link Float#NaN}) is defined by * {@link Float#compareTo}; {@code NaN} is greater than positive infinity. * @see #sortableIntToFloat */ public static int floatToSortableInt(float val) { return sortableFloatBits(Float.floatToIntBits(val)); }
@Override public long get(int docID) { return NumericUtils.sortableFloatBits((int) view.get(docID)); } };
@Override public long longValue() throws IOException { return NumericUtils.sortableFloatBits((int) in.longValue()); } };
@Override public long get(int docID) { return NumericUtils.sortableFloatBits((int) view.get(docID)); } };