lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 0c8789e0 4/6: Further improve documentation,


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0c8789e0 4/6: Further improve documentation, removing a defect marker [274]
Date: Sun, 1 May 2022 16:54:19 -0400 (EDT)

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

    Further improve documentation, removing a defect marker [274]
---
 financial.hpp | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/financial.hpp b/financial.hpp
index 72e7e233..7eba93bb 100644
--- a/financial.hpp
+++ b/financial.hpp
@@ -35,15 +35,11 @@
 
 class calendar_date;
 
-// TODO ?? Things to reconsider later:
-//
-// v*v*v...*v != v^n because of floating-point roundoff.
-//
-// The a priori irr bounds ought to be parameterized.
-//
-// When no root is bracketed, -100% is always conservative enough;
-// but if a root is known to exceed the a priori upper bound, then
-// perhaps that upper bound could be returned instead.
+/// Future value.
+///
+/// For values of 'i' close to zero, accuracy is limited because
+/// v*v*v*...*v != v^n due to floating-point roundoff; but using
+/// 'long double' mitigates that.
 
 template<typename InputIterator>
 long double fv
@@ -79,6 +75,12 @@ long double fv
 ///   - it's more accurate for x86_64, by two orders of magnitude; and
 ///   - it's as fast for x86_64, and maybe faster for i686 (x87); and
 ///   - the resulting NPV is identical across architectures.
+///
+/// When no root is bracketed, -100% is always conservative enough:
+/// financially, it means "you lose all your money", which is the
+/// worst outcome possible. The a priori upper bound of +100000% is
+/// about as good as any arbitrary value; if the true IRR is even
+/// higher, then reporting it as 100000% is conservative.
 
 template<typename InputIterator>
 class irr_helper
@@ -110,7 +112,7 @@ class irr_helper
         root_type const z = decimal_root
             (*this
             ,-1.0       // A priori lower bound.
-            ,1000.0     // Assumed upper bound.
+            ,1000.0     // A priori upper bound.
             ,bias_lower // Return the final bound with the lower FV.
             ,decimals_
             ,64



reply via email to

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