[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: Specifying signs when f(0)=0
Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
First, it is important that sqrt(-0) = 0 (either +0 or -0), ...
Well, yes, but that is because of the inconsistent handling of
zero. If -0 were a true negative infinitesimal, then sqrt(-0)
would clearly be NaN.
Then, why -0 instead of +0? I don't know. ...
Your explanation is ingenious, but implausible :-)
One that I heard, but haven't checked out thoroughly, is that it is
needed for interval arithmetic. The claim was that the interval
[-0,x] includes true zero, whereas [+0,x] doesn't. I was and am
unconvinced, but would need to study the matter further to be sure.
However, if the tests are a problem, enabling traps allows to avoid them.
They are more-or-less deprecated by IEEE 754, IEEE 754R and C99.
LIA supports them, but is not in fashion.
Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1@xxxxxxxxx
Tel.: +44 1223 334761 Fax: +44 1223 334679