-
Notifications
You must be signed in to change notification settings - Fork 32
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 ] some mistakes #64
Conversation
Did you mean «try it»? idris2-tutorial/src/Tutorial/Eq.md Line 897 in 1c89da7
|
result is still out of bounds: | ||
modulo `2^bitsize` and subtracting `2^bitsize` if the result is still out of | ||
range. For instance, for `Int8`, all operations calculate their results modulo | ||
256, subtracting 256 if the result is still out of bounds: | ||
|
||
```repl | ||
Main> the Int8 2 * 127 |
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.
Following the old explanation:
2 * 127 = 254 % 256 - 128 = 126
The correct way to subtract 2^bitsize
:
2 * 127 = 254 % 256 - 256 = -2
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Let's discuss this in its own PR. The two versions - your and mine - have distinct performance characteristics. In the current version of |
Thanks a lot for these corrections. |
This should be an example of an implicit argument
idris2-tutorial/src/Tutorial/Eq.md
Lines 486 to 499 in 1c89da7