-
Notifications
You must be signed in to change notification settings - Fork 10
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
fix: amend incorrect int bound check #65
fix: amend incorrect int bound check #65
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for it! 💯
I think that a test for the edge case being addressed here would be great. |
Great idea! Just added a couple tests and fixed some bugs I had missed :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
Just added a persistent question xD
int64 numbers range from
-9,223,372,036,854,775,808
to9,223,372,036,854,775,807
.When checking if an int64 is in a valid range, we have to check whether its absolute value is smaller or equal than
9,223,372,036,854,775,808
for negative numbers, and smaller or equal than9,223,372,036,854,775,807
for positive numbers.Without this fix,
9,223,372,036,854,775,808
is taken as a valid int64 number which is not.