more useful options | |
PerlMonks |
Re^3: Math::FixedPrecision and bignum clashby McA (Priest) |
on Oct 08, 2014 at 14:41 UTC ( [id://1103180]=note: print w/replies, xml ) | Need Help?? |
Hi mje, IMHO your assumption of rounding in Math::FixedPrecision is not true. When you have a look at the constructor of Math::FixedPrecision you'll see the the value 3.145 having 3 digits after the point will be rounded to two digits (what is given as second parameter) with ffround (line 80 of sources). The effect you see is caused by mathematical (odd) rounding (default of Math::BigFloat) with your example. Have a look at these two examples:
UPDATE: Added output for the reader. Regards
In Section
Seekers of Perl Wisdom
|
|