#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

#158 in Algorithms

Download history 67517/week @ 2024-08-17 79066/week @ 2024-08-24 86227/week @ 2024-08-31 80678/week @ 2024-09-07 75462/week @ 2024-09-14 82211/week @ 2024-09-21 84390/week @ 2024-09-28 85888/week @ 2024-10-05 85601/week @ 2024-10-12 89708/week @ 2024-10-19 78004/week @ 2024-10-26 94435/week @ 2024-11-02 71760/week @ 2024-11-09 71605/week @ 2024-11-16 73866/week @ 2024-11-23 61688/week @ 2024-11-30

291,964 downloads per month
Used in 1,056 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