Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding {ilog, ilog2, ilog10} to PrimInt #313

Open
Elizafox opened this issue Mar 15, 2024 · 1 comment
Open

Adding {ilog, ilog2, ilog10} to PrimInt #313

Elizafox opened this issue Mar 15, 2024 · 1 comment

Comments

@Elizafox
Copy link

Elizafox commented Mar 15, 2024

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.

@cuviper
Copy link
Member

cuviper commented Mar 26, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants