Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IEEE-754 vs. two's complement

14 views
Skip to first unread message

"Martin v. Löwis"

unread,
Oct 27, 2008, 7:04:40 PM10/27/08
to
IEEE-754 choses a sign+magnitude representation for the value of a
floating point number, and a bias representation for the exponent.
In both cases, using a two's complement representation would be a
workable option.

While I understand why a bias representation for the exponent is
preferable (for lexicographical comparison, given that the
magnitude can be already compared lexicographical), I'm wondering
what the rationale for choosing a signed representation was.

I understand that this representation allows to distinguish
between +0.0 and -0.0, but I doubt that this was the original
motivation (indeed, some Kahan papers indicate that implementations
should treat them equally).

Any inside appreciated,

Martin

nm...@cam.ac.uk

unread,
Oct 28, 2008, 2:36:31 AM10/28/08
to
In article <49064909$0$26684$9b62...@news.freenet.de>,

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <mar...@v.loewis.de> wrote:
>IEEE-754 choses a sign+magnitude representation for the value of a
>floating point number, and a bias representation for the exponent.
>In both cases, using a two's complement representation would be a
>workable option.

And some of us have used machines with just such representations.

>While I understand why a bias representation for the exponent is
>preferable (for lexicographical comparison, given that the
>magnitude can be already compared lexicographical), I'm wondering
>what the rationale for choosing a signed representation was.

It makes analysis and optimisation marginally easier - for example,
if x is representable, so is -x.

>I understand that this representation allows to distinguish
>between +0.0 and -0.0, but I doubt that this was the original
>motivation (indeed, some Kahan papers indicate that implementations
>should treat them equally).

No, it predates IEEE 754 by a considerable margin. It had gained
general acceptance by 1970, and was regarded as 'the right way'
by 1980. That was despite the fact that there was plenty of
evidence that twos complement representations were perfectly good.

Let's not start on the IEEE 754 signed zero, er, saga ....


Regards,
Nick Maclaren.

0 new messages