[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 907e53fa 2/2: Rename an argument
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 907e53fa 2/2: Rename an argument |
Date: |
Tue, 10 May 2022 04:12:55 -0400 (EDT) |
branch: master
commit 907e53faf67afdd20e02c09f990ce6d1aa69e12b
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Rename an argument
max_modal_premium() has a 'specamt' argument that really must represent
specified amount, but rate_times_currency() has an 'amount' argument
that's more general.
---
ul_utilities.cpp | 10 +++++-----
ul_utilities.hpp | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/ul_utilities.cpp b/ul_utilities.cpp
index 744007b5..83f76dbe 100644
--- a/ul_utilities.cpp
+++ b/ul_utilities.cpp
@@ -97,7 +97,7 @@ double list_bill_premium
currency rate_times_currency
(double rate
- ,currency specamt
+ ,currency amount
,round_to<double> const& rounder
)
{
@@ -108,7 +108,7 @@ currency rate_times_currency
constexpr int radix {100'000'000};
// Premium rate and specified amount are nonnegative by their nature.
LMI_ASSERT(0.0 <= rate);
- LMI_ASSERT(C0 <= specamt);
+ LMI_ASSERT(C0 <= amount);
// Do not save and restore prior rounding direction, because lmi
// generally expects rounding to nearest everywhere.
std::fesetround(FE_TONEAREST);
@@ -134,16 +134,16 @@ currency rate_times_currency
<< std::flush
;
#endif // 0
- return rounder.c(specamt * rate);
+ return rounder.c(amount * rate);
}
#if 0
// Enable this assertion, adjusting the tolerance (last) argument
// p.r.n., if no table is allowed to have more than eight decimals.
LMI_ASSERT(materially_equal(bourn_cast<double>(irate), rate * radix));
#endif // 0
- // Multiply integer rate by integral-cents specamt.
+ // Multiply integer rate by integral-cents amount.
// Use a large integer type to avoid overflow.
- int64 iprod = irate * bourn_cast<int64>(specamt.cents());
+ int64 iprod = irate * bourn_cast<int64>(amount.cents());
// Result is an integer--safe to represent as double now.
// Function from_cents() has its own value-preservation test.
currency cprod = from_cents(bourn_cast<double>(iprod));
diff --git a/ul_utilities.hpp b/ul_utilities.hpp
index af485310..4886c3b1 100644
--- a/ul_utilities.hpp
+++ b/ul_utilities.hpp
@@ -41,7 +41,7 @@ double list_bill_premium
currency rate_times_currency
(double rate
- ,currency specamt
+ ,currency amount
,round_to<double> const& rounder
);