Class FloatingPointBitsConverterUtil
- java.lang.Object
-
- io.prestosql.operator.aggregation.FloatingPointBitsConverterUtil
-
public final class FloatingPointBitsConverterUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long
doubleToSortableLong(double value)
Converts a double value to a sortable long.static int
floatToSortableInt(float value)
Converts a float value to a sortable int.static float
sortableIntToFloat(int value)
Coverts a sortable int to float.static double
sortableLongToDouble(long value)
Converts a sortable long to double.
-
-
-
Method Detail
-
doubleToSortableLong
public static long doubleToSortableLong(double value)
Converts a double value to a sortable long. The value is converted by getting their IEEE 754 floating-point bit layout. Some bits are swapped to be able to compare the result as long.
-
sortableLongToDouble
public static double sortableLongToDouble(long value)
Converts a sortable long to double.- See Also:
sortableLongToDouble(long)
-
floatToSortableInt
public static int floatToSortableInt(float value)
Converts a float value to a sortable int.- See Also:
doubleToSortableLong(double)
-
sortableIntToFloat
public static float sortableIntToFloat(int value)
Coverts a sortable int to float.- See Also:
sortableLongToDouble(long)
-
-