[Bug libstdc++/34419] Weirdness with numeric_limits in special functions
3dw4rd at verizon dot net
gcc-bugzilla@gcc.gnu.org
Sun Oct 5 01:34:00 GMT 2008
------- Comment #3 from 3dw4rd at verizon dot net 2008-10-05 01:33 -------
Subject: Re: Weirdness with numeric_limits in special
functions
paolo dot carlini at oracle dot com wrote:
> ------- Comment #2 from paolo dot carlini at oracle dot com 2008-10-03 10:54 -------
> Any news Ed?
>
>
>
Yes. Regarding the problem with being called with integral arguments,
the promote tool which enforces the srd:: requirement that calling a
math function with integral argument should trigger the double call.
Ints get promoted to double, then all the floating point numbers are
promoted up to the biggest float type.
I verified that even calling the template versions with explicit
template arguments cannot cause an int to go through.
1. Maybe this should be a test? Probably, as it is a requirement. I
should probably test a lot of promotion. Actually, I'm not sure how I
would make a test case off the top of my head.
2. The ability to call the template versions is not standard. It sure
does make things cleaner though.
REgarding the sqrt of numeric_limits::epsilon() I tested this on x86
Linux and MacOSX PPC and it works. The square root of an number less
than one is larger than the original number. The answers are pretty
accurate but int the interest of lack of scary lookingness I have a
patch that does things like sqrt(100*epsilon)/10.
I'll fix up the patch.
Ed
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34419
More information about the Gcc-bugs
mailing list