avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] Bug in math library


From: Colin O'Flynn
Subject: Re: [avr-libc-dev] Bug in math library
Date: Sun, 9 Jan 2005 11:04:23 -0400
User-agent: KMail/1.7.1

> By the rigorous rules of mathematics "division by zero is undefined".
> An exception should be thrown or flagged.   I do not know where
> the common idea that division by zero results in the answer of  infinity
> originated.

I assume from the fact that the limit of x / y, as y approaches 0 is infinity. 
However x/0 is in fact quite undefined, and IMHO it should always result in a 
NaN returned. As long as the rest of the floating point routines respect this 
NaN, it will show up at the output of the system therefore alerting the 
programmer (or someone) that an illegal math operation was attempted and 
there is a bug somewhere.

> As an interesting aside a negative zero, by law in Canada, must never be
> displayed on a weight-scale.

Those crazy Canadians ;-)

Regards,

 -Crazy Canuck Colin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]