Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

is_prime

Check if the given number is prime

Arguments

  • n - The given number
  • iter - The number of iterations to run when sqrting the number, the higher the more accurate (usually 10 is enough)

Returns

  • bool - if the given number is prime

Fully qualified path: alexandria_math::is_prime::is_prime

pub fn is_prime(n: u128, iter: u32) -> bool