Online Java Compiler By
JavaTpoint.com
public class Float_floatToRawIntBitsMethod_Example1 { public static void main(String[] args){ //returns the bits that represent the floating-point number Float obj=9.8f; System.out.println(obj +" value in Raw int bits = " + Float.floatToRawIntBits(obj)); //0/0 argument is NaN, Float obj1 = 0.0f/0.0f; System.out.println(obj1 + " value in Raw int bits = " + Float.floatToRawIntBits(obj1)); // positive integer divided by zero gives infinity Float obj2 = obj/0; System.out.println(obj2 + " value in Raw int bits = " + Float.floatToRawIntBits(obj2)); // negative integer divided by zero gives negative infinity Float obj3 = -obj/0.0f; System.out.println(obj3 + " value in Raw int bits = " + Float.floatToRawIntBits(obj3)); } }
Output