-1

Why do we have to add bias or convert an exponent of IEEE floating point number in its 2's or 1's complement form ?? why can't we store it like this in single precision :

1.1 * 2^0 => 0 00000000 10000000000000000000000

instead of this:

1.1 * 2^ (0 + 127) => 0 01111111 10000000000000000000000

thanks

Mark Dickinson
  • 29,088
  • 9
  • 83
  • 120

1 Answers1

2

The bias format for the exponent let you do this nice trick:

Given a floating point f, denote with <f> its binary representation.
Denote with + the integer addition.

Then

<f> + 1 = nextafter(f) 

towards the infinity of the same sign of f.

This is true as long as the sum doesn't affect the sign bit.

Margaret Bloom
  • 41,768
  • 5
  • 78
  • 124