23 Dec
2008
23 Dec
'08
11 a.m.
Max schrieb:
Hello,
It's strange to me that there seems not to be a std::abs<>() function in STL, with it I can write code like this:
double d = std::abs(-1.0); int i = std::abs(-1);
Does anybody else have the same feeling?
#include <cmath> double d = std::abs (-1.0); cmath pulls the standard math functions into the std namespace, and adds a few overloads. See for example: http://www.dinkumware.com/manuals/?manual=compleat&page=math.html#abs Cheers, Anteru