[Cfp-interest 2845] Re: The leading (or negative field) bit on a NaN

Mike Cowlishaw mfc at speleotrove.com
Thu Aug 24 07:43:18 PDT 2023


I would say that's a question to ask on the 754 list, not here :-).  By
definition NaNs are not numbers so do not have a sign.  I just find it
convenient to think of the NaN's payload as having a sign -- which is not
suggesting that the NaN has a sign.

Mike 

> -----Original Message-----
> On Thu, 24 Aug 2023, Mike Cowlishaw wrote:
> 
> > Technically its 'just another bit'.  However, in my 
> > testcases I treat 
> > the payload of the NaN as being a signed integer having the 
> > value of 
> > the significand and signed by treating that bit as a sign 
> > bit.  This 
> > to me, is useful and unambiguous, and it also works for 
> > both decimal 
> > significand codings..
> 
> I was looking at in the context of the projection of a complex number
> 
>  	x + I y
> 
> onto the eextended complex plane (as modelled by a Riemann 
> sphere) of a complex number with an infinite part. This is 
> the 'cproj' routine.
> 
> It returns
> 
>  	INFINOYI + I (+|-0.0)
> 
> where the sign of that zero is directly affected by the sign of 'y'.
> 
> However, I cannot see how, if 'y' is a NaN, that its payload 
> details, specifically the 'sign' bit, should influence the 
> sign of that 0.0.
> 
> Just curious.
> 
> Or is the reason definitional to provide reproducible results?
> 
> Thanks - Damian
> 



More information about the Cfp-interest mailing list