-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add IRR to cashloan and migrate functions to lib_financial.h #1223
base: develop
Are you sure you want to change the base?
Conversation
Also clean up IRR code
Declare all functions in lib_financial.h Clean up comments and update URLs to code references
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Mac and Linux GitHub Actions to pass, please add the following to the lib_financial.cpp file for DBL_MAX to be defined:
DBL_MAX is defined in float.h and was previously included at the top of each financial compute module as
#ifndef WIN32
#include <float.h>
#endif
} | ||
|
||
double scale_factor = irr_scale_factor(cf_vector, count); | ||
double residual = DBL_MAX; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DBL_MAX was not defined and is causing the Linux and MacOS tests to fail.
DBL_MAX is defined in float.h and was previously included at the top of each financial compute module as
#ifndef WIN32
#include <float.h>
#endif
Fix #638
1. Add IRR output to cashloan
2. Move financial model functions to lib_financial for all financial models
depreciation_sched_custom()
using namespace libfin
from cmod* Note that Third Party Ownership - Host model has payback cashflows but does not use the payback() function to calculate payback period.
Question
That there are special
min()
andmax()
functions defined in lib_financial. I changed all calls tomin()
andmax()
in the financial cmods tolibfin::min()
andlibfin::max()
to avoid conflict, but should any of those bestd::min()
orstd::max()
instead?