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