#square-root #inverse #integer #memoized

memo_int_sqrt

Memoized square root and inverse square root for integers

2 releases

Uses old Rust 2015

0.1.1 Feb 5, 2019
0.1.0 Feb 4, 2019

#1990 in Data structures

40 downloads per month

MIT license

6KB
122 lines

memo_int_sqrt

Definitely run the benchmarks before using this. In my benchmarking, I found that for f32s, .sqrt().recip() is often faster than using the lookup table. For f64s, the lookup table is faster for inverse squareroot, but not for squareroot.

No runtime deps