[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/eraseme_long_double_irr 7fcf08e2 2/3: Annotate a
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/eraseme_long_double_irr 7fcf08e2 2/3: Annotate an arcanum |
Date: |
Sat, 30 Apr 2022 12:17:39 -0400 (EDT) |
branch: odd/eraseme_long_double_irr
commit 7fcf08e2b55d4f73b41a487c3e41299dd9807276
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Annotate an arcanum
---
ihs_basicval.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index ee238efd..ef273b05 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -1512,6 +1512,8 @@ currency BasicValues::GetModalSpecAmtCorridor(currency
annualized_pmt) const
{
int const k = round_corridor_factor().decimals();
double const s = nonstd::power(10, k);
+ // Do not save and restore prior rounding direction because
+ // lmi generally expects rounding to nearest everywhere.
std::fesetround(FE_TONEAREST);
double const z = std::nearbyint(s * GetCorridorFactor()[0]);
return round_min_specamt().c((z * annualized_pmt) / s);