Skip to content

Conversation

@aduzsardi
Copy link

No description provided.

# Error: Unhandled exception: Division by 0 (DivisionByZeroError)
```
Note that unlike some other programming languages crystal is using floored division to calculate modulus (in JavaScript this would yield -1)
Copy link
Member

Choose a reason for hiding this comment

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

Thing here is that, javascripts % isnt modulo, it is remainder, thereby another type of calculation.

Copy link
Author

Choose a reason for hiding this comment

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

it is using the same operator so nomater what the type of calculation is it's still confusing for some people (as it was for me)

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