简体   繁体   中英

Converting IEEE single precision to decimal

If S = 0, E = 01110011, and F = 100101

E would be 115 right? and if so would that make the exponent -12?

If the Bias is 127.

Here's how your number parses as a 32-bit SP IEEE-754 float:

                  3  2          1         0
                  1 09876543 21098765432109876543210
                  S ---E8--- ----------F23----------
          Binary: 0 01110011 10010100000000000000000
             Hex: 39CA 0000
       Precision: SP
            Sign: Positive
        Exponent: -12 (Stored: 115, Bias: 127)
       Hex-float: +0x1.94p-12
           Value: +3.8528442e-4 (NORMAL)

The stored exponent is 115 , which coresponds to -12 with a bias of 127 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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