[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] Adding elapsed time
From: |
Joerg Wunsch |
Subject: |
Re: [avrdude-dev] Adding elapsed time |
Date: |
Wed, 30 Jul 2003 16:05:42 +0200 |
User-agent: |
Mutt/1.2.5i |
As Theodore A. Roth wrote:
> It's usually a bad idea to test for equality with a float since the
> equality may never be true due to the nature of floats (does 0 ==
> 10^-400?).
Comparision against constant 0.0 is guaranteed to work though. 0.0 is
one of the FP numbers that has a fixed bit pattern, like +Inf, +NaN,
-Inf, -NaN. Note that there's a +0.0 as well as a -0.0, but they are
supposed to compare identical (which they don't do on the AVR, btw. --
there are more lurking compatibility bugs in that respect, but that's
merely off-topic here ;-).
Other powers of two can also be compared exactly (1.0 for example),
but that's already an implementation detail, while the mentioned
absolute constants are IMHO guaranteed to exist and to be comparable
by the IEEE standard.
> Been too long since I had to deal with gettimeofday(), so I can't
> pass judgement on that.
IMHO, Posix (SUSPv<something> now) doesn't standardize it but
standardizes getnanotime() instead. No idea whether the Cygwin
etc. environments do already all emulate this.
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/
- Re: [avrdude-dev] Adding elapsed time, (continued)
- Re: [avrdude-dev] Adding elapsed time, Theodore A. Roth, 2003/07/29
- Re: [avrdude-dev] Adding elapsed time, Brian Dean, 2003/07/29
- Re: [avrdude-dev] Adding elapsed time, Brian Dean, 2003/07/29
- Re: [avrdude-dev] Adding elapsed time, Theodore A. Roth, 2003/07/29
- RE: [avrdude-dev] Adding elapsed time, Alex Shepherd, 2003/07/29
- Re: [avrdude-dev] Adding elapsed time, Brian Dean, 2003/07/29
- RE: [avrdude-dev] Adding elapsed time, Alex Shepherd, 2003/07/30
- RE: [avrdude-dev] Adding elapsed time, Theodore A. Roth, 2003/07/30
- RE: [avrdude-dev] Adding elapsed time, Alex Shepherd, 2003/07/30
- Re: [avrdude-dev] Adding elapsed time, Brian Dean, 2003/07/30
- Re: [avrdude-dev] Adding elapsed time,
Joerg Wunsch <=
- Re: [avrdude-dev] Adding elapsed time, Theodore A. Roth, 2003/07/30
- Re: [avrdude-dev] Adding elapsed time, Joerg Wunsch, 2003/07/31
- RE: [avrdude-dev] Adding elapsed time, Alex Shepherd, 2003/07/29