diff options
Diffstat (limited to 'src/math/random.c')
| -rw-r--r-- | src/math/random.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/math/random.c b/src/math/random.c index da4bc2c..519ce6b 100644 --- a/src/math/random.c +++ b/src/math/random.c @@ -3,6 +3,7 @@ * Copyright (C) 2017 J08nY */ #define _POSIX_C_SOURCE 200809L + #include "random.h" #include <time.h> @@ -43,13 +44,11 @@ GEN random_prime(unsigned long bits) { gel(range, 2) = powis(gen_2, bits); GEN p; - { - pari_sp btop = avma; - do { - p = randomprime(range); - p = gerepileupto(btop, p); - } while (!isprime(p)); - } + pari_sp btop = avma; + do { + p = randomprime(range); + p = gerepileupto(btop, p); + } while (!isprime(p)); return gerepilecopy(ltop, p); } |
