This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
Re: abs(int) missing
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: Re: abs(int) missing
- From: Steven King <sxking at uswest dot net>
- Date: Thu, 17 Aug 2000 08:38:15 -0700
- Organization: is the root of all evil
- Reply-To: sxking at uswest dot net
On Thu, 17 Aug 2000, Levente Farkas wrote:
> hi,
> it seems to me that abs(int) is missing from std namespace!!!
> -----------------------
> #include <cmath>
>
> int main()
> {
> int i = std::abs(4);
> return 0;
> }
No, its there. std::abs (int) (and std::abs (long)) is defined in cstdlib;
cmath add overloads for float, double and long long double and is not required
to define std::abs (int). see 26.5 of the standard.
--
Steven King
sxking@uswest.net