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

chore: make more add/sub test use variable num_blocks #1717

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tmontaigu
Copy link
Contributor

No description provided.

Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

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

Two small questions/remarks

Comment on lines 558 to 563
if modulus == 1 {
// Basically have one bit the sign bit can't really test
// Basically have one bit, the sign bit can't really test
continue;
}
Copy link
Member

Choose a reason for hiding this comment

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

this is even worse than that, we can't represent any value with such a modulus, the intended (?) test would be modulus <= 2 ?

Same everywhere

Copy link
Contributor Author

@tmontaigu tmontaigu Oct 28, 2024

Choose a reason for hiding this comment

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

Hum its not really clear when reading, but, the modulus here is actually the half_modulus since its obtained by doing modulus / 2, so its the modulus ignoring the sign bit

So if half_modulus == 1 then it means we have one bit which is the sign bit, as the 'value' bits only allow represent values with half_modulus == 1 so nothing

Copy link
Member

Choose a reason for hiding this comment

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

ok got it, so the naming is a bit misleading

Copy link
Member

Choose a reason for hiding this comment

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

are we able to test the minimum value then for a signed integer ?
i.e.

-2^b for some b ? as using the modulus on the abs value would limit us to -2^b + 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will update the naming

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