Skip to content

[std] Optimize integer powers with 2 ** y case #1610

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

Merged
merged 3 commits into from
Jan 30, 2021
Merged

[std] Optimize integer powers with 2 ** y case #1610

merged 3 commits into from
Jan 30, 2021

Conversation

MaxGraey
Copy link
Member

@MaxGraey MaxGraey commented Jan 5, 2021

It's pretty often case especially with retrieving mask in generic way like 2 ** (sizeof<T>() * 8) - 1 which return -1 in case with power operation and 0 in case with left shift (1 << (sizeof<T>() * 8)) - 1.

  • I've read the contributing guidelines

@dcodeIO dcodeIO merged commit ba28ea0 into AssemblyScript:master Jan 30, 2021
@MaxGraey MaxGraey deleted the opt-int-pow-for-pot branch January 30, 2021 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants