GNOME Bugzilla – Bug 107876
Crash when financial calculator is to calculate zero interest
Last modified: 2018-07-02 07:11:46 UTC
GnuCash crashes when I tell the financial calculator to calculate the interest rate, and the other values are such that the interest rate would be zero. For example: - payment period = 10 - present value = 10000 - periodic payment = -1000 - future value = 0 i.e. interest rate should be 0. btw why is it impossible to enter a zero interest rate?
0% interest is not a Loan, it's just a limited-count scheduled payment. Although you are correct that the calculator should not crash.
Reproduced in svn r13238. It's not actually a crash though, the code is printing "Zero Interest" to the terminal and calling exit(1) so gnucash shuts down (in preference to causing a divide by zero that would have followed on the next line). I've committed a fix that prevents the shutdown and avoids the division by zero. The interest rate is shown as '-'. Fixed in r13248.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=107876. Please update any external references or bookmarks.