Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Table 4 proposal version 0.2...



John Pryce wrote:
> I just looked at what the standard says (IEEE 754-2008, §9.2.1) and
> am appalled.

There was a lot of debate and compromising about chapter 9.

> I can just about live with max(x,NaN)=x, though there should have
> been two kinds of max & min defined, one of which does as above,
> and the other always propagates NaNs.

At some point we did have maxNum() vs max() -- the former ignoring
NaN (interpreting it as "absent" rather than "invalid"), and the
latter honouring the usual NaN-propagation rules.  Dan Z may remember
why we ended up with just one, maxNum().  Luckily we did keep the name.

> But the scenario
>   computation X produces x, but goes wrong so x is NaN,
>   computation Y produces y, which just by chance is exactly 0,
>   then we do x¬y so the NaN disappears,
> seems a HORRIBLE design choice.

Well, 754-2008 deliberately says nothing about x^y; instead, it
offers a set of interpretations, pown, powr and pow -- with the
latter deliberately treating integral floating-point values
specially, because some programming environments expected that.

In John's scenario the powr function would have been appropriate.

Note that 1788 also distinguishes a family of pown() functions, and
the pow() function which is defined like 754's powr.  The name "powr"
is unfortunately ambiguous, and 1788 uses it to denote a pown-like
family with exact rational exponents, not 754's real exponents.

Michel.
---Sent: 2012-04-05 15:32:31 UTC