Class NumberUtils


  • public final class NumberUtils
    extends java.lang.Object
    • Constructor Detail

      • NumberUtils

        public NumberUtils()
    • Method Detail

      • floatToIntBits

        public static int floatToIntBits​(float value)
      • floatToRawIntBits

        public static int floatToRawIntBits​(float value)
      • floatToIntColor

        public static int floatToIntColor​(float value)
        Converts the color from a float ABGR encoding to an int ABGR encoding. The alpha is expanded from 0-254 in the float encoding (see intToFloatColor(int)) to 0-255, which means converting from int to float and back to int can be lossy.
      • intToFloatColor

        public static float intToFloatColor​(int value)
        Encodes the ABGR int color as a float. The alpha is compressed to use only even numbers between 0-254 to avoid using bits in the NaN range (see Float.intBitsToFloat(int) javadocs). Rendering which uses colors encoded as floats should expand the 0-254 back to 0-255, else colors cannot be fully opaque.
      • intBitsToFloat

        public static float intBitsToFloat​(int value)
      • doubleToLongBits

        public static long doubleToLongBits​(double value)
      • longBitsToDouble

        public static double longBitsToDouble​(long value)