delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/03/22/09:38:54

Message-Id: <200003221407.JAA07292@delorie.com>
From: "Dieter Buerssner" <buers AT gmx DOT de>
To: djgpp-workers AT delorie DOT com
Date: Wed, 22 Mar 2000 15:08:08 +0100
MIME-Version: 1.0
Subject: Re: Unnormals???
CC: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
References: <200003210709 DOT IAA03083 AT father DOT ludd DOT luth DOT se>
In-reply-to: <Pine.SUN.3.91.1000322102807.17945F-100000@is>
X-mailer: Pegasus Mail for Win32 (v3.12b)
Reply-To: djgpp-workers AT delorie DOT com

On 22 Mar 00, Eli Zaretskii wrote:
 
> On Tue, 21 Mar 2000 ams AT ludd DOT luth DOT se wrote:
> 
> > The copysign functions produce a value with the magnitude of x and
> > the sign of y. They produce a NaN (with the sign of y) if x is a
> > NaN."
> > 
> > This means the standard do think that NaNs have a sign (however
> > misguided that is)
> 
> No, they only think a NaN *might* have a sign.  If there's no notion
> of a sign of a NaN, the copying a sign to it does nothing.

I think there speaks nothing against the interpretation of the sign 
bit. There was an interesting post in comp.std.c from Nick MacLaren.
I show the relevant parts here:

[...]
> IEEE 754 6.3 starts by saying "This standard does not interpret
> the sign of a NaN."
> 
> The informative appendix is the source of the confusion.  It says:
> 
>     (1) Copysign(x,y) returns x with the sign of y.  Hence
> abs(x) = copysign(x,1.0), even if x is a NaN.
>     (2) -x is x copied with its sign reversed, not 0-x; the
> distinction is germane when x ia +-0 or a NaN.
[...]
> Now, neither IEEE 754 nor C90 state explicitly what should be
> done when the second argument to copysign is a NaN, but C90
[I think, he meant C99, but I could be wrong]
> does include enough to make it clear that the intent is that
> copysign(1.0,x) returns the 'sign' of a NaN and thus the
> macro signbit is expected to expand into that.  For example:
[...]

The message-ID  of the post is <8b7sls$bqv$1 AT pegasus DOT csx DOT cam DOT ac DOT uk>

Regards,
Dieter


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019