diff options
Diffstat (limited to 'src/wheel-gen.pl')
-rwxr-xr-x | src/wheel-gen.pl | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/wheel-gen.pl b/src/wheel-gen.pl index 987619de3..96fb48f05 100755 --- a/src/wheel-gen.pl +++ b/src/wheel-gen.pl @@ -50,7 +50,7 @@ sub is_prime ($) and return 0; $d += $w; $q < $d - and last; + and last; $w = 2; } return 1; @@ -68,12 +68,12 @@ sub is_prime ($) for (my $i = 3; ; $i += 2) { if (is_prime $i) - { - push @primes, $i; - $product *= $i; - ++$n_primes == $wheel_size - and last; - } + { + push @primes, $i; + $product *= $i; + ++$n_primes == $wheel_size + and last; + } } my $ws_m1 = $wheel_size - 1; @@ -92,20 +92,20 @@ EOF { my $rel_prime = 1; foreach my $divisor (@primes) - { - $i != $divisor && $i % $divisor == 0 - and $rel_prime = 0; - } + { + $i != $divisor && $i % $divisor == 0 + and $rel_prime = 0; + } if ($rel_prime) - { - #warn $i, ' ', $i - $prev, "\n"; - push @increments, $i - $prev; - $prev = $i; - - $product + 1 < $i - and last; - } + { + #warn $i, ' ', $i - $prev, "\n"; + push @increments, $i - $prev; + $prev = $i; + + $product + 1 < $i + and last; + } } print join (",\n", @increments), "\n"; |