简体   繁体   English

计算由十六进制浮点数表示的值

[英]Calculating value represented by hexadecimal floating-point numeral

Can someone explain how we calculate the value of Hexadecimal Floating point constant. 有人可以解释我们如何计算十六进制浮点常数的值。 I was reading a book and found 0x0.3p10 represents the value 192. 我正在读一本书,发现0x0.3p10代表值192。

The exponent is still expressed in decimal, but the base is two, and the mantissa is in hex. 指数仍以十进制表示,但基数为2,尾数为十六进制。

So 0.3P10 is (3 × 16 −1 ) × 2 10 , which is 3/16 × 2 10 , which is 3 × 2 6 = 192. 因此0.3P10是(3×16 -1 )×2 10 ,即3/16×2 10 ,即3×2 6 = 192。

Each hex digit of the mantissa gobbles up four units of exponent, since 16 = 2 4 . 尾数的每个十六进制数字吞噬四个指数单位,因为16 = 2 4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM