0
如何从double
类型提取字节。我知道它有8个字节,就像long
。我怎样才能创建一个long
与double
具有相同字节的变量。C#如何从双提取字节
double a = 1.5;
long b = (long)a; // <- this returns 1
// i want to get this: 0 01111111111 1000000000000000000000000000000000000000000000000000
//which is 4609434218613702656 as long (I guess :))
我该如何快速做到这一点?
的可能的复制[如何获得一个“双”作为一个“长”](https://stackoverflow.com/questions/4475611/how-to-get-the-bits双倍长的) – harold