8:04 pm - Thursday April 25, 2019

Double Example Program for doubleToLongBits(double value)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
//program name: Example Program for doubleToLongBits(double value)
/**
 * @ author:candid.com
 *
 * @description: Returns a representation of the specified floating-point value
 *               according to the IEEE 754 floating-point "double format" bit
 *               layout.
 */
public class Doubleto {
	public static void main(String args[]) {
		double i = 78.0;
		long l = Double.doubleToLongBits(i);
		// this converts the double value to long bits in ieee 754 format.
		System.out.print(l);
	}
}

output:
4635189178982727680

Filed in: Z-A All Java Codes

Comments are closed.