Double.doubleToLongBits equivalent in C#?

筅森魡賤 提交于 2019-12-08 19:17:59

问题


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



来源:https://stackoverflow.com/questions/6816691/double-doubletolongbits-equivalent-in-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!