Behind the scenes, what's happening with decimal value type in C#/.NET?

后端 未结 6 1383
囚心锁ツ
囚心锁ツ 2020-12-30 02:18

How is the decimal type implemented?

Update

  • It\'s a 128-bit value type (16 bytes)
  • 1 sign bit
  • 96 bits (1
6条回答
  •  太阳男子
    2020-12-30 02:24

    The decimal type is just another form of floating point number - but unlike float and double, the base used is 10.

    A simple explanation is here http://csharpindepth.com/Articles/General/Decimal.aspx

提交回复
热议问题