Here you can find the source of doubleToHexString(double val)
Parameter | Description |
---|---|
val | a parameter |
public static String doubleToHexString(double val)
//package com.java2s; //License from project: Apache License public class Main { /**/* w w w. ja v a2 s . com*/ * * @param val * @return */ public static String doubleToHexString(double val) { long reversed = Long.reverseBytes(Double.doubleToLongBits(val)); String res = Long.toHexString(reversed); res = "0000000000000000".substring(res.length()) + res; return res; } }