This is the mail archive of the
mailing list for the GCC project.
Re: [basic-improvements] Use double instead of float for timevar
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Matt Austern <austern at apple dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 08 Nov 2002 13:56:37 -0800
- Subject: Re: [basic-improvements] Use double instead of float for timevar
- References: <C1335596-F363-11D6-9521-000393B2ABA2@apple.com>
Matt Austern <firstname.lastname@example.org> writes:
> As mentioned on email@example.com: timevar works by storing
> various times as 'float' values, and then subtracting them
> to get time intervals.
> This is a very bad idea. On most platforms, float only
> gives you 24 bits of precision. Subtract two largish
> 24-bit numbers and you'll often be left with nothing but
> Here's a patch to use double instead of float, tested on
> ppc/darwin. OK to commit to BIB?
> * timevar.[ch]: Use double instead of float for time stamps.
- Geoffrey Keating <firstname.lastname@example.org>