abs(long long)

Gabriel Dos Reis gdr@integrable-solutions.net
Tue Oct 2 16:29:00 GMT 2012


On Tue, Oct 2, 2012 at 9:34 AM, Daniel Krügler
<daniel.kruegler@gmail.com> wrote:
> 2012/10/2 Marc Glisse <marc.glisse@inria.fr>:
>> Here I am talking of a library issue: the wording that says that there are
>> sufficient overloads such that integer types call the double version of math
>> functions. It is fairly obvious that it doesn't apply to abs(long) for
>> instance which has an explicit overload. For short or unsigned, I still read
>> it as saying that it converts to double...
>
> This really looks like a problem of the Standard Library specification
> to me and
> a corresponding issue should be submitted. In fact the wording can be
> interpreted
> that mixing <cstdlib> with <cmath> would imply two different versions of
> std::abs(int) because of different required return types. I will
> prepare a corresponding
> submission to the LWG.

This was already an issue I reported to LWG when C++98 came out.
Now that you hold  wrtite access to the issue document, you can
make sure it won't slip through the crack this time :-p

-- Gaby



More information about the Libstdc++ mailing list