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