I just tried out the behaviour of Perl in this case and found this:
perl -e "print 1/10"
gives the result 0.1
Also does
perl -e "print 1.0 / 10"
and
perl -e "print 1.0 / 10.0".
But
perl -e "print 100.1 - 100.0"
gives the well known 0.0999999999999943.
(All under ActiveStates Perl 5.8.0 under Windows 2000.)
Is there a special mechanism in Perl that "saves" the fraction? Or do I miss something else?
In reply to Re: Math 101 anyone?
by Crian
in thread Math 101 anyone?
by smcone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |