This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: include/limits compile time overflow
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: DJ Delorie <dj at redhat dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Wed, 3 Nov 2010 10:11:36 -0500
- Subject: Re: include/limits compile time overflow
- References: <201011022332.oA2NWIFu028382@greed.delorie.com>
On Tue, Nov 2, 2010 at 6:32 PM, DJ Delorie <dj@redhat.com> wrote:
> // The fraction 643/2136 approximates log10(2) to 7 significant digits.
> #define __glibcxx_digits10(T) \
> ?(__glibcxx_digits (T) * 643 / 2136)
>
> #define __glibcxx_max_digits10(T) \
> ?(2 + (T) * 643 / 2136)
>
>
> Can we use smaller numbers, or switch the 643 to 643L to appease gcc?
>
Better yet, can we get it from a compiler intrinsic?
-- Gaby