[英]java: how can I convert double precision numbers to decimal
I want to convert double precision numbers to decimal . 我想将双精度数字转换为十进制。
for example I have 23.43, the double value would be (using matlab) : 174 71 255 122 20 110 55 64 now having this how can I write a java program that gives me 23.43 ? 例如我有23.43,则双精度值将是(使用matlab):174 71 255 122 20 110 55 64现在有了这个,我如何编写一个给我23.43的Java程序?
and here is the calculation of double precision in matlab : 这是matlab中双精度的计算:
MATLAB constructs the double data type according to IEEE Standard 754 for double precision. MATLAB根据IEEE标准754构造双精度数据类型以实现双精度。 Any value stored as a double requires 64 bits, formatted as shown in the table below: 任何存储为double的值都需要64位,格式如下表所示:
Bits Usage 比特用法
63 Sign (0 = positive, 1 = negative) 63号(0 =正,1 =负)
62 to 52 Exponent, biased by 1023 62到52的指数,偏向1023
51 to 0 Fraction f of the number 1.f 51至0数1.f的分数f
long l = Double.doubleToLongBits(double);
double d = Double.longBitsToDouble(long);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.