lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 28055a62 02/11: Realize the actual intention


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 28055a62 02/11: Realize the actual intention of a comparison
Date: Tue, 31 May 2022 17:52:05 -0400 (EDT)

branch: master
commit 28055a621a2fc28f92ce137e68119b2dc67d5b30
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Realize the actual intention of a comparison
    
    The intention was not to compare std::pow() to nonstd::power(),
    but to compare bin_exp() to both.
---
 bin_exp_test.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin_exp_test.cpp b/bin_exp_test.cpp
index b82064c7..8097ef62 100644
--- a/bin_exp_test.cpp
+++ b/bin_exp_test.cpp
@@ -264,7 +264,11 @@ void test_quodlibet()
     // Wolfram:    1748.219590818327062731185606025974266231060028076171875
     LMI_TEST_EQUAL(1748.2195908183271, bin_exp(12.04662322998046875, 3));
 
-    // Comparison to std::pow() and nonstd::power().
+    // Compare bin_exp() to std::pow() and nonstd::power().
+    double a0 = bin_exp
+        (static_cast<double>(std::numeric_limits<double>::radix)
+        ,                    std::numeric_limits<double>::digits
+        );
     double a1 = std::pow
         (static_cast<double>(std::numeric_limits<double>::radix)
         ,static_cast<double>(std::numeric_limits<double>::digits)
@@ -284,6 +288,7 @@ void test_quodlibet()
         (static_cast<long int>(std::numeric_limits<double>::radix)
         ,static_cast<long int>(std::numeric_limits<double>::digits)
         );
+    LMI_TEST_EQUAL(9007199254740992, a0);
     LMI_TEST_EQUAL(9007199254740992, a1);
     LMI_TEST_EQUAL(9007199254740992, a2);
     stifle_unused_warning(a3);



reply via email to

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