This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: include/limits compile time overflow


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]