Bit oriented calculation for float
static int floatToIntBits(float value)
- Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "single format" bit layout.
static int floatToRawIntBits(float value)
- Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "single format" bit layout, preserving Not-a-Number (NaN) values.
static float intBitsToFloat(int bits)
- Returns the float value corresponding to a given bit representation.
public class Main {
public static void main(String[] args) {
int i = Float.floatToIntBits(1.1F);
System.out.println(i);
}
}
The output:
1066192077
Home
Java Book
Essential Classes
Java Book
Essential Classes
Float:
- Float class
- MAX/MIN_VALUE Find out the Maximum value and Minimum value a float type can have
- Create a Float object
- Convert Float to byte, double, float, int, long and short
- Compare two float objects
- Infinite and Not A Number
- Convert float value to Hex String value
- Convert float value to String value
- Convert string value to float value
- Bit oriented calculation for float