#square-root #integer #primitive-integer #root #square #sqrt #isqrt

no-std integer-sqrt

An implementation of integer square root algorithm for primitive rust types

5 releases

Uses old Rust 2015

0.1.5 Sep 9, 2020
0.1.4 Sep 8, 2020
0.1.3 Jan 24, 2020
0.1.2 Oct 30, 2018
0.1.0 Oct 23, 2017

#160 in Algorithms

Download history 73647/week @ 2024-07-21 67397/week @ 2024-07-28 72142/week @ 2024-08-04 85861/week @ 2024-08-11 68363/week @ 2024-08-18 79076/week @ 2024-08-25 87398/week @ 2024-09-01 78964/week @ 2024-09-08 76657/week @ 2024-09-15 82605/week @ 2024-09-22 85628/week @ 2024-09-29 84239/week @ 2024-10-06 84631/week @ 2024-10-13 90726/week @ 2024-10-20 76812/week @ 2024-10-27 96709/week @ 2024-11-03

353,385 downloads per month
Used in 1,033 crates (29 directly)

Apache-2.0/MIT

7KB
108 lines

Integer square root

This module contains the single trait IntegerSquareRoot and implements it for primitive integer types.

Example

// `use` trait to get functionality
use integer_sqrt::IntegerSquareRoot;

assert_eq!(4u8.integer_sqrt(), 2);

lib.rs:

This module contains the single trait IntegerSquareRoot and implements it for primitive integer types.

Example

extern crate integer_sqrt;
// `use` trait to get functionality
use integer_sqrt::IntegerSquareRoot;

assert_eq!(4u8.integer_sqrt(), 2);

Dependencies

~150KB