To make print treat an expression in parenthesis as an argument (and not as the argument list) just put a '+' in front of the parenthesis' opening:
for my $i (1..20) { print "$i: "; print+(1-1/2000)**$i; print " - "; print+(1-1/2000)**int($i); print " - "; print "" . (1-1/2000)**$i; print "\n"; }
In reply to Re: strange arithmetic
by shmem
in thread strange arithmetic
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |