You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some potential cleanups for the traits and implementation:
Add a CheckedSquareRoot trait which could be implemented by Int (returning none for negative inputs). This could be a supertrait of SquareRoot.
Rename the SquareRoot trait for clarity, perhaps UintSquareRoot or FloorSquareRoot.
[ ] Implement the square root trait(s) for Montgomery forms (this makes FloorSquareRoot a less desirable name).
Rename Uint::sqrt/sqrt_vartime to isqrt or sqrt_unchecked to reflect the inexact nature of the result (and corresponding trait updates to match).
Implement square root traits and methods for OddUint for consistency. This would require changing the return type, but it seems reasonable to add an Output type to the trait(s).
Support nth roots based on algorithm 1.14 from the same source (Brent & Zimmermann, Modern Computer Arithmetic, v0.5.9). Should this be a separate trait?
Some potential cleanups for the traits and implementation:
CheckedSquareRoottrait which could be implemented byInt(returning none for negative inputs). This could be a supertrait of SquareRoot.SquareRoottrait for clarity, perhapsUintSquareRootorFloorSquareRoot.[ ] Implement the square root trait(s) for Montgomery forms (this makes.FloorSquareRoota less desirable name)Uint::sqrt/sqrt_vartimetoisqrtorsqrt_uncheckedto reflect the inexact nature of the result (and corresponding trait updates to match).OddUintfor consistency. This would require changing the return type, but it seems reasonable to add an Output type to the trait(s).