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
Added checked_sqrt to the FixedPointNumber trait (paritytech#8238)
Adds `checked_sqrt` function to `FixedPointNumber` and renames `const fn
try_sqrt` in the `implement_fixed` macro to `const fn checked_sqrt`.
CLOSES: paritytech#8214
## Integration
Any projects that use the **const** function `try_sqrt` from `FixedI64`,
`FixedU64`, `FixedI128`, `FixedU128` should now use `checked_sqrt`.
## Review Notes
- renamed the const `try_sqrt` with `checked_sqrt`
- updated tests for new name
- added `checked_sqrt` to impl of `FixedPointNumber`
We keep both the const version along with adding the non-const version
of `checked_sqrt` so that we can now access `checked_sqrt` from
associated types that implement `FixedPointNumber` without breaking all
of the uses of `sqrt` that rely on it being const.
---------
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
0 commit comments