Package io.trino.operator.aggregation
Class FloatingPointBitsConverterUtil
java.lang.Object
io.trino.operator.aggregation.FloatingPointBitsConverterUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic longdoubleToSortableLong(double value) Converts a double value to a sortable long.static intfloatToSortableInt(float value) Converts a float value to a sortable int.static floatsortableIntToFloat(int value) Coverts a sortable int to float.static doublesortableLongToDouble(long value) Converts a sortable long to double.
-
Method Details
-
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:
-
floatToSortableInt
public static int floatToSortableInt(float value) Converts a float value to a sortable int.- See Also:
-
sortableIntToFloat
public static float sortableIntToFloat(int value) Coverts a sortable int to float.- See Also:
-