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

Value: use interned values for min and max int for types #694

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

ehaas
Copy link
Collaborator

@ehaas ehaas commented Apr 29, 2024

This allows _BitInt's to use min/max int

This allows _BitInt's to use min/max int
@as(u128, if (unsigned) std.math.maxInt(u128) else std.math.maxInt(u128))
else
ty.maxInt(comp);
const max: u128 = switch (bit_count) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (and wcharMax) is to avoid Compilation depending on Value but can be changed if you want

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it better this way.

@as(u128, if (unsigned) std.math.maxInt(u128) else std.math.maxInt(u128))
else
ty.maxInt(comp);
const max: u128 = switch (bit_count) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it better this way.

@Vexu Vexu merged commit f230f45 into Vexu:master Apr 29, 2024
3 checks passed
@ehaas ehaas deleted the bitint branch May 3, 2024 05:12
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

Successfully merging this pull request may close these issues.

2 participants