diff options
Diffstat (limited to 'base/intmath.cc')
-rw-r--r-- | base/intmath.cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/base/intmath.cc b/base/intmath.cc index 099ab1c9a..f1c1651ba 100644 --- a/base/intmath.cc +++ b/base/intmath.cc @@ -29,30 +29,30 @@ #include "base/intmath.hh" int -PrevPrime(int n) +prevPrime(int n) { - int decr; + int decr; - // If the number is even, let's start with the previous odd number. - if (!(n & 1)) - --n; + // If the number is even, let's start with the previous odd number. + if (!(n & 1)) + --n; - // Lets test for divisibility by 3. Then we will be able to easily - // avoid numbers that are divisible by 3 in the future. - decr = n % 3; - if (decr == 0) { - n -= 2; - decr = 2; - } - else if (decr == 1) - decr = 4; + // Lets test for divisibility by 3. Then we will be able to easily + // avoid numbers that are divisible by 3 in the future. + decr = n % 3; + if (decr == 0) { + n -= 2; + decr = 2; + } + else if (decr == 1) + decr = 4; - for (;;) { - if (IsPrime(n)) - return n; - n -= decr; - // Toggle between 2 and 4 to prevent trying numbers that are known - // to be divisible by 3. - decr = 6 - decr; - } + for (;;) { + if (isPrime(n)) + return n; + n -= decr; + // Toggle between 2 and 4 to prevent trying numbers that are known + // to be divisible by 3. + decr = 6 - decr; + } } |