decimal in c# misunderstanding?

后端 未结 2 1593
名媛妹妹
名媛妹妹 2021-02-14 07:26

(while trying to analyze how decimal works ) && after reading @jonskeet article and seeing msdn , and thinking for the last 4 hours , I have some

2条回答
  •  遇见更好的自我
    2021-02-14 08:23

    why do they write 28-29 but display 2?

    For readability. It says "Approximate range" and 7.9E28 is more readable than 79228162514264337593543950335 (E0 here, not E1).

    how will decimal representation ( mantiss && exponent) will be displayed for the value 0.5 ?

    The exponent's range is -28...0, however, it is stored (and received via constructor parameters) as an absolute value of 0...28.

    So 0.5 Would have the same mantissa representation as 5 with an exponent of -1 (stored as 1).

提交回复
热议问题