lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 3c9845b4 06/10: State the purpose of a partic


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 3c9845b4 06/10: State the purpose of a particular unit test
Date: Mon, 20 Jun 2022 19:16:22 -0400 (EDT)

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

    State the purpose of a particular unit test
---
 round_to_test.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/round_to_test.cpp b/round_to_test.cpp
index cbc551c3..6302f2b2 100644
--- a/round_to_test.cpp
+++ b/round_to_test.cpp
@@ -532,6 +532,17 @@ void round_to_test::test_all_modes(bool synchronize)
     test_rounding();
 }
 
+/// Compare 1e8 * e / 1e8 in double vs. long double precision.
+///
+/// For x86_64:
+///   d0 == d1 == d3 == d4 != d2
+/// so the round trip is exact unless the 'double' reciprocal is
+/// stored in a variable.
+///
+/// It might be interesting to test 10^±N more generally. Here,
+/// N=8 just because rounding to more than eight decimals is
+/// relatively uncommon.
+
 void round_to_test::test_scaling()
 {
     scoped_ios_format meaningless_name(std::cout);



reply via email to

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