[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] [bug #23677] Request for cbrt() and strdup to be adde
From: |
Blake Leverett |
Subject: |
Re: [avr-libc-dev] [bug #23677] Request for cbrt() and strdup to be added to libc |
Date: |
Sun, 22 Jun 2008 21:34:15 -0600 |
User-agent: |
KMail/1.9.9 |
On Sunday 22 June 2008, Russell Shaw wrote:
> I *never* use straight fp equality in code (x==0.0 baaad).
>
> http://c-faq.com/fp/fpequal.html
> http://c-faq.com/fp/strangefp.html
In the references you gave, they use if (x == 0.0) in the example code.
IEEE floats and doubles both define 0.0 as a definite value. Namely, zeros in
all the bit fields. So I guess it's OK to use x == 0.0 as a comparison. But
x has to really be zero, not just very close to zero.
Blake