Float printing bug still around?
Paul Wallich <[email protected]> Tue, 24 Jun 2003 19:19:59 -0400
| Newsgroups | gmane.lisp.openmcl.bugs |
|---|---|
| Message-ID | <[email protected]> |
Or have I found something else?
I'm running 0.13.6 under OS X, and the following stupid code gives
screwy printouts (but proper underlying numbers) for anything more than
about 15 iterations when using integer values for all the inputs:
(defun loanlength (amount interest payment)
(let ((monthly-int (/ interest 1200)))
(do ((currentmonth 0 (1+ currentmonth))
(balance amount (- balance (- payment (* balance monthly-int)))))
((< balance 0) currentmonth)
(format t "~&Month ~D Balance ~,2F Equity Change ~,2F" currentmonth
balance)
(- payment (* balance monthly-int))))))
The rational representing the balance for a typical example is something
like
29479420866365225234014731893929685749/6058287395472553279488000000000000
when things go bad.
For the moment, "don't use integer arguments" seems like a perfectly
fine fix, but I was under the impression from reading the archive that
that bug had been stomped. Hence the question
thanks
paul