Note that what you're doing when printing is coercing a number to a string. Perl's principle is to do this in the most basic way it can. If the number is technically a float internally, but its decimal expansion is .0000..., its string conversion will just look like an int. If you want it to look different, consider sprintf.my $float = 0.00; print "$float\n"; # prints "0"
blokhead
In reply to Re: Integer vs Float during addition
by blokhead
in thread Integer vs Float during addition
by chrism01
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |