lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 6bc8c5b 3/4: Improve a unit test


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 6bc8c5b 3/4: Improve a unit test
Date: Wed, 14 Jul 2021 09:28:14 -0400 (EDT)

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

    Improve a unit test
    
    A standard-library implementation is likelier to be incorrect for
    the smallest denormal than for the smallest normal value.
---
 math_functions_test.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/math_functions_test.cpp b/math_functions_test.cpp
index dc0ee55..c8234e0 100644
--- a/math_functions_test.cpp
+++ b/math_functions_test.cpp
@@ -329,7 +329,7 @@ int test_main(int, char*[])
 {
     // Test assign_midpoint().
 
-    constexpr double smallnum = std::numeric_limits<double>::min();
+    constexpr double smallnum = std::numeric_limits<double>::denorm_min();
     constexpr double bignum   = std::numeric_limits<double>::max();
 
     std::vector<double> v0 {smallnum, bignum, 0.0, 0.0, 1.0, 100.0};



reply via email to

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