将十六进制的浮动常数转换为64位二进制表示

发布于 2025-02-01 22:49:42 字数 597 浏览 4 评论 0原文

我已经看过示例/参考,但我似乎无法围绕一些情况。

更具体地说,当数字为0x1.mmmmmpeee时,我可以解析Mantissa表示形式,即mmmmm和exponent,即eee eee < /代码>并将它们转换为二进制表示。将它们全部放在一起会给我我想要的东西。

但是,在等情况下,由于87 87 在0x之后,如何将此十六进制的mantissa解析为位二进制表示?

I have seen examples/references/previous questions, but I cannot seem to get my head around some of the cases.

To be more specific, when the numbers is 0x1.MMMMMpEEE, then I can parse out the mantissa representation, which is MMMMM and the exponent, which is EEE and convert them to binary representation. Putting them all together will give me what I want.

However, in cases like 0x8.60a91c16b9b28p-4 or 0x7.ffffffffffffcp-4, because of the 8 and 7 after the 0x, how do I parse this hexadecimal mantissa into bit-wise binary representation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文