Save This Page
Home » openjdk-7 » java » lang » [javadoc | source]
java.lang
final class: VMFloat [javadoc | source]
java.lang.Object
   java.lang.VMFloat
Code relocated from java.lang.Float by
Method from java.lang.VMFloat Summary:
floatToIntBits,   floatToRawIntBits,   intBitsToFloat
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.lang.VMFloat Detail:
 static native int floatToIntBits(float value)
    Convert the float to the IEEE 754 floating-point "single format" bit layout. Bit 31 (the most significant) is the sign bit, bits 30-23 (masked by 0x7f800000) represent the exponent, and bits 22-0 (masked by 0x007fffff) are the mantissa. This function collapses all versions of NaN to 0x7fc00000. The result of this function can be used as the argument to Float.intBitsToFloat(int) to obtain the original float value.
 static native int floatToRawIntBits(float value)
    Convert the float to the IEEE 754 floating-point "single format" bit layout. Bit 31 (the most significant) is the sign bit, bits 30-23 (masked by 0x7f800000) represent the exponent, and bits 22-0 (masked by 0x007fffff) are the mantissa. This function leaves NaN alone, rather than collapsing to a canonical value. The result of this function can be used as the argument to Float.intBitsToFloat(int) to obtain the original float value.
 static native float intBitsToFloat(int bits)
    Convert the argument in IEEE 754 floating-point "single format" bit layout to the corresponding float. Bit 31 (the most significant) is the sign bit, bits 30-23 (masked by 0x7f800000) represent the exponent, and bits 22-0 (masked by 0x007fffff) are the mantissa. This function leaves NaN alone, so that you can recover the bit pattern with Float.floatToRawIntBits(float).