in reply to Incremental indexing exponential
I tried to get this to you earlier, but I couldn't get the 'push @{$prec}' working because I thought it was an array (not an arrayref. :\ )
This code is along the lines of 'Aren't you really just counting up to a number using base 4?'
use Math::BaseArith; my $base = 4; #Start with 2 digits of precision my $prec = [$base, $base]; for my $i (2..3) { my $max = ($base ** $i); PREC: for my $line (0..4**$i) { last PREC if ($line >= $max ); #Check for overflow print encode( $line, $prec), "\n"; } push @{$prec}, $base; #+Another digit of precision. }
That was kind of fun!
Update: Made numeric comp (>=), and corrected max.
Kurt
|
|---|