From 559f5f93e52ad1dfb65bb69c87d75abf54b71cfe Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 8 Apr 2003 09:42:03 +0000 Subject: [PATCH] Added an osg::absolute template function into osg/Math. --- include/osg/Math | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/osg/Math b/include/osg/Math index 12f670f17..48f3abd36 100644 --- a/include/osg/Math +++ b/include/osg/Math @@ -108,6 +108,11 @@ const double PI = 3.14159265358979323846; const double PI_2 = 1.57079632679489661923; const double PI_4 = 0.78539816339744830962; +/** return the minimum of two values, equivilant to std::min. + * std::min not used because of STL implementation under IRIX contains no std::min.*/ +template +inline T absolute(T v) { return v<(T)0?-v:v; } + /** return the minimum of two values, equivilant to std::min. * std::min not used because of STL implementation under IRIX contains no std::min.*/ template