Fix prime number

master
Xavier Arteaga 4 years ago committed by Xavier Arteaga
parent 8de73988b8
commit aa8b69e9a7

@ -31,7 +31,7 @@ int srslte_prime_greater_than(uint32_t n)
{ {
for (uint32_t i = 0; i < NOF_PRIME_NUMBERS; i++) { for (uint32_t i = 0; i < NOF_PRIME_NUMBERS; i++) {
if (prime_numbers[i] > n) { if (prime_numbers[i] > n) {
return n; return prime_numbers[i];
} }
} }
@ -47,7 +47,7 @@ int srslte_prime_lower_than(uint32_t n)
for (uint32_t i = NOF_PRIME_NUMBERS - 1; i > 0; i--) { for (uint32_t i = NOF_PRIME_NUMBERS - 1; i > 0; i--) {
if (prime_numbers[i] < n) { if (prime_numbers[i] < n) {
return n; return prime_numbers[i];
} }
} }

Loading…
Cancel
Save