Tuesday, 3 November 2015

Decimal layout

I've just had a few hours debugging decimals.

decimal x1 = 256m;
decimal.GetBits(x1).Dump();
Console.WriteLine(string.Format("{0}", x1));


decimal x2 = 256m * 1.0m;
decimal.GetBits(x2).Dump();
Console.WriteLine(string.Format("{0}", x2));


http://msdn.microsoft.com/en-us/library/system.decimal.getbits(v=vs.110).aspx

No comments:

Post a comment