Pure Programmer
Blue Matrix


Cluster Map

Project: Amortization Table (Revisited)

In the AmortizationTable1 project we had a problem with accumulation error in our balance. We can avoid this problem by working with integers whenever possible. If we take value like the payment or balance that is represented in dollars and cents then multiply it by 100, we can convert a decimal value to an integer value. Re-write the Amortization Table project to use long integers for the payment, interest, principle and balance.

Output
$ perl AmortizationTable2.pl 10000 0.05 2 "pow" is not exported by the Math::Trig module Can't continue after import errors at AmortizationTable2.pl line 9. BEGIN failed--compilation aborted at AmortizationTable2.pl line 9.

Solution