num-traits icon indicating copy to clipboard operation
num-traits copied to clipboard

Adding {ilog, ilog2, ilog10} to PrimInt

Open Elizafox opened this issue 1 year ago • 1 comments

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.

Elizafox avatar Mar 15 '24 20:03 Elizafox

They can go on PrimInt if you can figure out generic default implementations.

cuviper avatar Mar 26 '24 01:03 cuviper