Because the range operator (integer iterator) is not affected by bigint. You can also do:
use strict; use warnings; use bigint; my $answer = 0; for my $i ( map 0+$_,1 .. 999 ) { print "$i: $answer\n"; $answer += $i ** $i; } $answer %= 10 ** 10; print "$answer\n";
In reply to Re: c-style for loop versus list for loop, and bigint
by BrowserUk
in thread c-style for loop versus list for loop, and bigint
by AR
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |