[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/gpt dc43995 4/5: Rewrite assertions for clarity
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/gpt dc43995 4/5: Rewrite assertions for clarity |
Date: |
Tue, 27 Apr 2021 12:13:46 -0400 (EDT) |
branch: odd/gpt
commit dc43995cee8df7d83faf8f4d5100848a075a31f6
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Rewrite assertions for clarity
See:
https://lists.nongnu.org/archive/html/lmi/2021-04/msg00049.html
---
gpt_commutation_functions.cpp | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/gpt_commutation_functions.cpp b/gpt_commutation_functions.cpp
index 67ee091..7351c2b 100644
--- a/gpt_commutation_functions.cpp
+++ b/gpt_commutation_functions.cpp
@@ -61,7 +61,6 @@ std::vector<T>& back_sum(std::vector<T>& v, E e)
/// - 'issued_today' and 'duration' are mutually consistent:
/// - if the policy was issued today, its duration must be zero
/// - if duration != 0, the policy cannot have been issued today
-/// thus: NOT ('true == issued_today' AND '0 != duration')
/// - a 1035 exchange can occur only on the issue date
///
/// 7702 !! Reconsider this:
@@ -94,8 +93,19 @@ void assert_sanity(gpt_scalar_parms const& args)
LMI_ASSERT(args.endt_bft <= args.f3_bft);
- LMI_ASSERT(!(args.issued_today && 0 != args.duration));
- LMI_ASSERT( args.issued_today || 0.0 == args.gross_1035);
+ if(args.issued_today)
+ {
+ LMI_ASSERT(0 == args.duration);
+ }
+ if(0 != args.duration)
+ {
+ LMI_ASSERT(!args.issued_today);
+ }
+
+ if(0.0 != args.gross_1035)
+ {
+ LMI_ASSERT(args.issued_today);
+ }
}
/// Constructor.