in reply to Decimal Arithmetic

You could investigate to see if there is a binary-coded decimal module for Perl (although during a rather cursory search on CPAN, I did not find one). HIstorically, financial programming in COBOL was done with BCD (also known as packed decimal) as it maps better to decimal currency than the computers' normal binary arithmetic.

emc

Insisting on perfect safety is for people who don't have the balls to live in the real world.

—Mary Shafer, NASA Dryden Flight Research Center

Replies are listed 'Best First'.
Re^2: Decimal Arithmetic
by Anonymous Monk on Feb 09, 2007 at 08:17 UTC
    See also the FAQ at http://www2.hursley.ibm.com/decimal/ for why it's a good idea to avoid binary floating-point. There's also a link there to the Perl BigNum library: http://dev.perl.org/perl6/pdd/pdd14_bignum.html which follows the General Arithmetic Specification. mfc