lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] valyuta/007 e8a5d1a4 17/18: Temporarily filter out f


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/007 e8a5d1a4 17/18: Temporarily filter out factor-of-100 errors
Date: Sun, 24 Apr 2022 18:46:15 -0400 (EDT)

branch: valyuta/007
commit e8a5d1a47465cbb34fd1bc00f4d7e48a94123e52
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Temporarily filter out factor-of-100 errors
    
    This temporary workaround is obviously not suitable for production,
    and will immediately be reverted.
---
 ihs_crc_comp.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ihs_crc_comp.cpp b/ihs_crc_comp.cpp
index 7ba3bc40..ab2e4c9a 100644
--- a/ihs_crc_comp.cpp
+++ b/ihs_crc_comp.cpp
@@ -305,6 +305,13 @@ void f_3(std::string const& line1, std::string const& 
line2)
                 (d1 - d2)
             /   ((0.0 == d1) ? d2 : d1)
             );
+    long double rel_err2 =
+        std::fabs(
+                (d1 / 100.0 - d2)
+            /   ((0.0 == d1) ? d2 : d1)
+            );
+    if(0.989 < rel_err && rel_err < 0.991)
+        rel_err = rel_err2;
     max_rel_err = std::max(max_rel_err, rel_err);
 
     if(rel_err < 1.0E-11L)



reply via email to

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