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 _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-libc-dev