"p" 在浮点数的指数十六进制表示法中代表什么

What does "p" stand for in the exponential hex notation for floats

在十六进制表示法中,数字 40.0 写成 0x1.4000000000000p+5,意思是 (1 + 4/16) * 2⁵

p 代表什么?据推测,选择该字母是有原因的。

它只是意味着“力量”

By convention, the letter P (or p, for "power") represents times two raised to the power of, whereas E (or e) serves a similar purpose in decimal as part of the E notation. The number after the P is decimal and represents the binary exponent. Increasing the exponent by 1 multiplies by 2, not 16. 10.0p1 = 8.0p2 = 4.0p3 = 2.0p4 = 1.0p5. Usually, the number is normalized so that the leading hexadecimal digit is 1 (unless the value is exactly 0).

https://en.wikipedia.org/wiki/Hexadecimal#Hexadecimal_exponential_notation

选择

P 是因为 E 是有效的十六进制数字,因此它可能出现在尾数部分