Skip to content

Conversation

@seafoamteal
Copy link
Contributor

Lots of people were confused by the apparent difference in behaviour between int.modulo and % during Day 1 of Advent of Code. The docs were a bit unclear because they recommended % as an alternative for int.modulo even though they do different things.

I've removed the confusing bit and added a little note specifying the behaviour of int.modulo. I've added the same note for float.modulo.

Specify difference between int.modulo and int.remainder / %
Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Very nice, thank you

@lpil lpil merged commit 65bc5ec into gleam-lang:main Dec 1, 2025
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