双到长而在Java中没有转换 [英] double to long without conversion in Java
本文介绍了双到长而在Java中没有转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将double转成long保留其二进制结构,而不是数值。只是改变类型,但保留二进制值。
I need to turn double into long preserving its binary structure, not number value. Just change type, but leave binary value as it is. Is there a native way to do it?
推荐答案
有 Double 与doubleToLongBits和doubleToLongRawBits。 Javadoc是您的朋友。
There is Double with to doubleToLongBits and doubleToLongRawBits. Javadoc is your friend.
这篇关于双到长而在Java中没有转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文