[英]Double.doubleToLongBits equivalent in C#?
there's a Java method Double.doubleToLongBits
that basically gets a double
and return a long
with the same bits. 有一个Java方法
Double.doubleToLongBits
,它基本上得到一个double
并返回一个具有相同位的long
。
How can I do it in C#? 我怎么能在C#中做到这一点?
Thank you 谢谢
BitConverter.DoubleToInt64Bits
would be a good alternative. BitConverter.DoubleToInt64Bits
将是一个不错的选择。
http://msdn.microsoft.com/en-us/library/system.bitconverter.doubletoint64bits.aspx http://msdn.microsoft.com/en-us/library/system.bitconverter.doubletoint64bits.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.