开发者

floating point number [duplicate]

开发者 https://www.devze.com 2023-04-08 06:49 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: extracting mantissa and exponent from double in c#
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

extracting mantissa and exponent from double in c#

How do you separate the fraction and the exponent in a floating point number?

In C++, I was able to use a "union", but unions are not allowed in C#.

union  {开发者_StackOverflowfix lc; long double cv;} ldblun;


BitConverter.DoubleToInt64Bits()

Then just shift and mask.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号