Skip to content

Conversation

PureFox48
Copy link
Contributor

As far back as #127 @munificent admitted that an integer division operator was a 'missing piece' in Wren's treatment of integers as it was tedious having to write (a/b).truncate all the time.

I opened a discussion about this in #907 but it was decided there was no suitable symbol available. This left the possibility of adding an instance method to the Num class: a.div(b) or a.quo(b) instead and I felt that the latter was preferable as it was more suggestive of integer division.

Although I decided to close the issue at the time, after two more years tedium of having to write (a/b).truncate I've concluded that a.quo(b) would be a sensible 'best effort' for this, particularly if we implement it in C to maximize performance. Hence the reason for this PR.

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.

1 participant