diff options
author | Loren J. Rittle <ljrittle@acm.org> | 2002-09-19 04:26:25 +0000 |
---|---|---|
committer | Loren J. Rittle <ljrittle@gcc.gnu.org> | 2002-09-19 04:26:25 +0000 |
commit | b433da3caca7c973a6521d339aee3e5f0976125e (patch) | |
tree | 0eb97f4ad8e3ff81414aee520b58f07cf1fa89ea | |
parent | bf3d27e6892e4438d183062340ce17e39cb9fa9d (diff) | |
download | gcc-b433da3caca7c973a6521d339aee3e5f0976125e.zip gcc-b433da3caca7c973a6521d339aee3e5f0976125e.tar.gz gcc-b433da3caca7c973a6521d339aee3e5f0976125e.tar.bz2 |
* testsuite/18_support/numeric_limits.cc (test_epsilon): New.
From-SVN: r57295
-rw-r--r-- | libstdc++-v3/ChangeLog | 4 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/18_support/numeric_limits.cc | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 62835f5..8ee3825 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2002-09-18 Loren J. Rittle <ljrittle@acm.org> + + * testsuite/18_support/numeric_limits.cc (test_epsilon): New. + 2002-09-18 Richard Henderson <rth@redhat.com> * testsuite/18_support/numeric_limits.cc: Add -mieee for alpha. diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits.cc b/libstdc++-v3/testsuite/18_support/numeric_limits.cc index 2213b7f..65fc8d0 100644 --- a/libstdc++-v3/testsuite/18_support/numeric_limits.cc +++ b/libstdc++-v3/testsuite/18_support/numeric_limits.cc @@ -94,6 +94,16 @@ void test_extrema<long double>() } #endif +template<typename T> +void test_epsilon() +{ + bool test = true; + T epsilon = std::numeric_limits<T>::epsilon(); + T one = 1; + + VERIFY( one != (one + epsilon) ); +} + #ifdef __CHAR_UNSIGNED__ #define char_is_signed false #else @@ -314,6 +324,10 @@ int main() test_extrema<double>(); test_extrema<long double>(); + test_epsilon<float>(); + test_epsilon<double>(); + test_epsilon<long double>(); + test_sign(); test_infinity<float>(); |