Class FloatingPointBitsConverterUtil


  • public final class FloatingPointBitsConverterUtil
    extends Object
    • 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)