简体   繁体   English

如何将601.0转换为IEEE-754单精度

[英]How to convert 601.0 to IEEE-754 Single Precision

I am trying to understand how to convert from decimal to IEEE-754 Single Precision binary representation. 我试图了解如何从十进制转换为IEEE-754单精度二进制表示形式。

I make up a random number which happen to be 601.00 我组成一个随机数,刚好是601.00

I tried my best to figure it out and this is what I got: 我尽力弄清楚了,这就是我得到的:

Step 01: I divided 601 by 9 (since 2^9 is the largest power of 2 divisible by my number) so I got 66.7778 步骤01:我将601除以9(因为2 ^ 9是按数字除以2的最大幂),所以我得到66.7778

Step 02: I have for the exponent 9 + 127 = 136 which is 10001000 in binary. 步骤02:我的指数为9 + 127 = 136,二进制为10001000。 Step 03: The sign is 0 步骤03:符号为0

Right now the representation is: (missing the mantissa) 0 10001000 现在的表示形式是:(缺少尾数)0 10001000

But what is the mantissa representation for 66.7778 in binary? 但是66.7778的尾数表示形式是什么?

Step 1 should be: divide 601 by 2^9, not by 9. 步骤1应该是:将601除以2 ^ 9,而不是除以9。

To get the mantissa, subtract 1 from the result of the division and multiply it by 2^23. 要获得尾数,请从除法结果中减去1,然后将其乘以2 ^ 23。 Express the integer part of the product in binary. 用二进制表示乘积的整数部分。 You can (and should) collapse the two steps, so that you end up multiplying (601 - 2^9) * 2^14. 您可以(并且应该)折叠这两个步骤,以便最终乘以(601-2 ^ 9)* 2 ^ 14。

暂无
暂无

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

相关问题 将二进制字符串转换为IEEE-754单精度-Python - Convert a binary string into IEEE-754 single precision - Python 将十六进制转换为IEEE-754单精度浮点二进制科学计数法 - Convert hexadecimal to IEEE-754 single precision floating point binary scientific notation 将IEEE-754双精度和单精度转换为十进制Java错误 - Converting IEEE-754 double and single precision to decimal Java bug IEEE-754 单精度表示的最大绝对和相对误差? - Maximum absolute and relative error of IEEE-754 single precision representation? 使用IEEE-754 Single Precision可以表示多少个标准化数字? - How many normalized numbers can be represented using IEEE-754 Single Precision? 如何生成随机(IEEE-754 单精度)浮点文件? - How do I generate a file of random (IEEE-754 single-precision) floats? 如何将float转换为double(都存储在IEEE-754表示中)而不会丢失精度? - How to convert float to double(both stored in IEEE-754 representation) without losing precision? 如何将 DEC 64 位双精度浮点数转换为 IEEE-754(DEC 不是十进制) - How to convert DEC 64bit double precision floating point to IEEE-754 (DEC is not decimal) 尝试表示 2^(-23) 时,无法在单精度 IEEE-754 中掌握“转换引起的错误” - Trouble grasping "error due to conversion" in single-precision IEEE-754 when attempting to represent 2^(-23) Javascript - 将十六进制转换为 IEEE-754 64 位双精度 - Javascript - Convert hex to IEEE-754 64-bit double precision
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM