Weirdness with numeric_limits in new special functions

Ed Smith-Rowland 3dw4rd@verizon.net
Sun May 13 14:32:00 GMT 2007


Paolo Carlini wrote:
> Hi,
>
>> The public functions in std::tr1: call these with floating point 
>> types only.
>>
>> I think the errtol *is* a mistake because __eps / 8 will degenerate 
>> to 0.  The errtol should wind up being rather larger than __eps.
>>
>> It might be a good idea to block calling with integral _Tp somehow.
>>
>> Actually, let me walk through the code and make sure what's going on.
>
> any news about this issue?
>
> Thanks in advance,
> Paolo.
>
I started working on this but then work flared up bug time.

I think I can return to this a week from now or maybe during this week.

I also remembered that we use these template functions that promote the 
types of all the arguments according to the rules set forth in the 
standard and in TR1.  One of which is that if an integer is supplied in 
a slot expecting some floating point type then the integer is promoted 
to double and the appropriate overload is called.  These functions are 
in common.h.  I think this sufficiently blocks calling with integral _Tp.

Maybe, if it hasn't already been done, I could try my hand at using 
variadic templates to replace __promote_1, __promote_2, ..., 
__promote_4. ;-)

Ed



More information about the Libstdc++ mailing list