aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@merlin.codesourcery.com>2000-08-21 10:45:26 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2000-08-21 10:45:26 +0000
commit4b6243ef72a6fe62d2263a87965d66d47828d411 (patch)
tree996494084c91ee7c94506788b43ee8b1d68927ab
parent24805e803ba2b70713b20c4734e1d993d225ba17 (diff)
downloadgcc-4b6243ef72a6fe62d2263a87965d66d47828d411.zip
gcc-4b6243ef72a6fe62d2263a87965d66d47828d411.tar.gz
gcc-4b6243ef72a6fe62d2263a87965d66d47828d411.tar.bz2
* bits/std_cmath.h (std::abs): Overload for int and long.
From-SVN: r35837
-rw-r--r--libstdc++-v3/ChangeLog4
-rw-r--r--libstdc++-v3/bits/std_cmath.h10
2 files changed, 14 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 83b3915..024a7ba 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,7 @@
+2000-08-21 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * bits/std_cmath.h (std::abs): Overload for int and long.
+
2000-08-20 Benjamin Kosnik <bkoz@gnu.org>
* src/string-inst.cc: Tweak instantiations for new-gxx-abi.
diff --git a/libstdc++-v3/bits/std_cmath.h b/libstdc++-v3/bits/std_cmath.h
index c25afa6..dd21e4f 100644
--- a/libstdc++-v3/bits/std_cmath.h
+++ b/libstdc++-v3/bits/std_cmath.h
@@ -43,6 +43,16 @@
namespace std {
+ //
+ // int
+ //
+
+ inline int abs(int i)
+ { return i < 0 ? i : -i; }
+
+ inline long abs(long i)
+ { return i < 0 ? i : -i; }
+
//
// float
//