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