num-traits
num-traits copied to clipboard
Adding {ilog, ilog2, ilog10} to PrimInt
This is a breaking change, but one in line with how the language has evolved.
{ilog, ilog2, ilog10} should all be methods in PrimInt. These have been stable for almost 2 years.
Also probably the checked variants, too.
The signatures are essentially
pub const fn ilog(self) -> u32;
pub const fn ilog2(self) -> u32;
pub const fn ilog10(self) -> u32;
EDIT: as a stopgap, these could go in a ILog trait and just be there for use to avoid breaking everything.
They can go on PrimInt if you can figure out generic default implementations.