[cfe-dev] [libcxx/test] Puzzling floating point behaviour

Eli Friedman eli.friedman at gmail.com
Fri Dec 9 20:34:37 PST 2011


On Fri, Dec 9, 2011 at 8:23 PM, Edward Meewis
<ed at extraordinarymachine.nl> wrote:
> On 10-12-11 1:34, Eli Friedman wrote:
>>
>> On Fri, Dec 9, 2011 at 7:58 AM, Edward Meewis
>> <ed at extraordinarymachine.nl>  wrote:
>>>
>>> <snip>
>>>
>>>
>>> I'm guessing long doubles get demoted somewhere. Does anyone have an
>>> idea what the problem may be?
>>
>> I'm not getting quite the same results as you, but your testcase isn't
>> really testing what you want to test: std::exp is not the same as
>> ::exp.
>>
>> -Eli
>
> Thanks, Eli, that's probably a big clue, but I don't get it. This is
> probably a stupid question, but can you explain? I would expect all exp's to
> be in std::. What's the difference?

std::exp is the properly overloaded exp defined by the C++ standard.
::exp isn't overloaded, so it loses precision.

-Eli




More information about the cfe-dev mailing list