Java Float intBitsToFloat() methodThe intBitsToFloat() method of Java Float class returns the float value in respect to a given bit representation. The argument which passed is considered to be a representation of a floating-point value according to the IEEE 754 floating-point 'single format' bit layout. Syntax:Parameters:In this method, bits parameter is passed which is an integer value. Return Value:This method returns the floating-point value with the same bit pattern.
Example 1Test it NowOutput: Float value after conversion = 1.06E-43 Float value after conversion = 6.819E-42 Float value after conversion = NaN Example 2Test it NowOutput: 2139095040 value = Infinity 2139095040 value = -Infinity Example 3Test it NowOutput: Enter first integer 567 1. Float value = 7.95E-43 Enter Second integer 67 2. Float value = 9.4E-44
Next TopicJava Float
|