For example
$ perl -e '$a+=0.1 for 1..10; print $a - 1' -1.11022302462516e-16
See also PerlFAQ4 - Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?
Update: Added example code
Update^2: Eventually found the FAQ
In reply to Re: perl floating number addition
by FunkyMonk
in thread perl floating number addition
by adismaug
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |