Rounding of binary floating point number's mantissa

51 views Asked by At

Consider I have mantissa of single precision floating point number (form 1.01001... (23 bit after point)).

I need to determine algorithm of rounding to the nearest even number.

My guess is: if mantissa's last bit is 0 then we return number without changes, otherwise I need to add (or subtract if number is negative) 0.000...01 (23 bits after the point). Is it right?

0

There are 0 answers