Fixed bug.

This commit is contained in:
Nicolás A. Ortega Froysa 2021-03-01 18:51:53 +01:00
parent a3c8bfa5f2
commit 7a755f7b05

View File

@ -36,9 +36,9 @@ fn main() {
let mut i = 0;
let mut test_prime = primes.get(i).unwrap();
let mut is_prime = true;
while *test_prime < (candidate as f64).sqrt() as u64
while *test_prime <= (candidate as f64).sqrt() as u64
{
if candidate % test_prime == 0
if candidate % *test_prime == 0
{
is_prime = false;
break;