[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);
- [lmi-commits] [lmi] master updated (876d4b5b -> 50009ece), Greg Chicares, 2022/06/20
- [lmi-commits] [lmi] master e986f0c9 02/10: Specify types more explicitly in unit test, Greg Chicares, 2022/06/20
- [lmi-commits] [lmi] master a6f2830d 01/10: Explain the necessity of a certain cast, Greg Chicares, 2022/06/20
- [lmi-commits] [lmi] master 3c9845b4 06/10: State the purpose of a particular unit test,
Greg Chicares <=
- [lmi-commits] [lmi] master 8f5b6960 04/10: Demonstrate object sizes in unit test, Greg Chicares, 2022/06/20
- [lmi-commits] [lmi] master 1744d568 07/10: Regularize every mention of nextafter(), Greg Chicares, 2022/06/20
- [lmi-commits] [lmi] master e711587c 08/10: Expunge a workaround for an obsolete compiler, Greg Chicares, 2022/06/20
- [lmi-commits] [lmi] master 168e9a70 03/10: Specify a constant more clearly, Greg Chicares, 2022/06/20
- [lmi-commits] [lmi] master 7258e4ae 05/10: Establish and test explicit postconditions, Greg Chicares, 2022/06/20
- [lmi-commits] [lmi] master 50009ece 10/10: x⋅(1+ε) ≢ nextafter(x) [264], Greg Chicares, 2022/06/20
- [lmi-commits] [lmi] master e7278f90 09/10: Add some functions to complement std::nextafter(), Greg Chicares, 2022/06/20