there's a Java method Double.doubleToLongBits
that basically gets a double
and return a long
with the same bits.
How can I do it in C#?
Thank you
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
BitConverter.DoubleToInt64Bits
would be a good alternative.
http://msdn.microsoft.com/en-us/library/system.bitconverter.doubletoint64bits.aspx
回答2:
You'll want BitConverter.DoubleToInt64Bits