简体   繁体   中英

Rounding IEEE floating point numbers

I'm currently doing an assignment where I have to find the value of a given IEEE floating point representation. For the assignment, there is 1 singed bit, 5 exponent bits and 3 frac bits.

The bits are : 1 11100 000

Since the frac bits are all zeroes, I'm guessing that means the mantissa is going to inf. How do I round this? I know of rounding to even, but I don't know how exactly to use it. Some assistance would be great.

Nope, as the mantissa always begins with a 1 digit, it is normally implicit , meaning that you have to add it to the left of the number.... in this case your number mantissa is 1000 . Infinity should be if the exponent has it's maximum value, as in 1 11111 000 for minus infinity, and 0 11111 000 for plus infinity.

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