const_primes

Function isqrt

Source
pub const fn isqrt(n: u64) -> u64
Expand description

Returns the largest integer smaller than or equal to √n.

§Examples

Basic usage:

const ISQRT25: u64 = isqrt(25);
const ISQRT35: u64 = isqrt(35);
const ISQRT36: u64 = isqrt(36);

assert_eq!(ISQRT25, 5);
assert_eq!(ISQRT35, 5);
assert_eq!(ISQRT36, 6);