lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master b551e76 2/2: Test C++11 round() along with C9


From: Greg Chicares
Subject: [lmi-commits] [lmi] master b551e76 2/2: Test C++11 round() along with C99 round*()
Date: Thu, 22 Dec 2016 13:43:40 +0000 (UTC)

branch: master
commit b551e76c4da3d84c431c5db75b6f33a7cec1516a
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Test C++11 round() along with C99 round*()
---
 round_test.cpp |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/round_test.cpp b/round_test.cpp
index 98d96ae..2a2c902 100644
--- a/round_test.cpp
+++ b/round_test.cpp
@@ -214,6 +214,9 @@ bool test_one_case
     )
 {
     RealType observed = roundFDL(unrounded);
+    // C++'s overloaded round should behave as if it calls C99's
+    // round(), roundf(), or roundl() as appropriate.
+    BOOST_TEST_EQUAL(std::round(unrounded), observed);
 
     max_prec_real abs_error = std::fabs(observed - expected);
     // Nonstandardly define relative error in terms of



reply via email to

[Prev in Thread] Current Thread [Next in Thread]