The implementation can now just use a normal generic impl. Note that
this is tecnically a minor breaking change, as if a user has both:
- A custom num_traits::PrimInt impl
- A custom IntegerSquareRoot impl
Their code will no longer compile
Signed-off-by: Joe Richey <joerichey@google.com>
This new algorithm (taken from Wikipedia) only uses shifts, addditions,
and subtrations. On my x86_64 machine, the benchmarks are over twice as
fast.
This also takes num-traits as a dependancy, so that the implementation
can be a normal generic function, instread of a macro.
Signed-off-by: Joe Richey <joerichey@google.com>