Neil Williams <[EMAIL PROTECTED]> writes: >> I also don't see why it matters here; there's nothing >> illegal about multiplying by zero. > > You'd have thought that, (I did), but reverting causes a permanent > loop to be setup.
Perhaps, then, you should move up a level and stop the loop from happening? >> You're also inconsistent with your checks. Sometimes you say: >> if (foo) > > The next line takes care of if (foo == 0.0) in the ? : ; conditional. We just > don't want this line executing: > CC = (CC - fv) / (CC + pv); > if CC == 0.0 Yes, I understand the /logic/ -- I'm just asking for consistency of coding. On the other hand, you should also probably check that (CC + pv) != 0.0 to make sure you don't get a div-by-zero error. >> Are you sure this code even still works? Is there a test case that shows >> the actual bug(s)? > > Yes and yes, in the bug report. > http://bugzilla.gnome.org/show_bug.cgi?id=107876 > > Enter any set of figures that would result from a zero-interest loan. > > e.g. Clear interest rate, clear future value and payment amount. Set payment > amount to a simple denominator of the loan amount (500) and future value to > zero. Click calculate. I meant a build-tree "make check" test case. Is there a "test-fin" that we can use to make sure these kinds of errors don't come up again? > Gnucash would simply shutdown with exit(1) - offering no chance to save the > current data file - hence the original bug. Now the calculator aborts and > displays an interest rate of '-' and gnucash keeps running. It's almost > intuitive, as errors go. > ;-) -derek -- Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory Member, MIT Student Information Processing Board (SIPB) URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH [EMAIL PROTECTED] PGP key available _______________________________________________ gnucash-devel mailing list [email protected] https://lists.gnucash.org/mailman/listinfo/gnucash-devel
