Re: Testing for IEEE infinity and NaN?




In article <fZudncNTJbHeigfZnZ2dnUVZ_tydnZ2d@xxxxxxxxxxx>,
"Tim Peters" <tim.one@xxxxxxxxxxx> writes:
|> >
|> > 1) On a system that implements infinities but with a different rule for
|> > rounding numbers that are exactly half way between representable numbers,
|> > 0.5*d can end up as d. I don't know if any have implemented that, but
|> > there have been several such variant implementations of IEEE 754, and I
|> > believe some other architectures have implemented infinities.
|>
|> I'll be sure to mention this to whoever volunteers to port Python to such a
|> platform :-)

I should sincerely HOPE that, IF such a platform appears, you would
change the constant! It is much better software engineering to avoid
platform-dependent code if it can be done cleanly without. But I agree
that no action is the right action until there is evidence that such a
platform becomes relevant :-)

|> That's all emulated in software for now, though -- has nothing to do with
|> the macros in pyport.h. Indeed, the FPU isn't used at all in the
|> implementation code now.

Well, I have always written code with the future in mind, and so was
assuming that the existing code was at least theoretically intended to
work on decimal floating-point hardware! After all, it used to exist :-)

But, as I have posted elsewhere, I shall look at the decimal module's
behaviour before going further. If it is intended to replace the current
floating-point one, then clearly effort should go there.


Regards,
Nick Maclaren.
.