-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
languageLanguage designLanguage design
Description
Currently % works the same way as Rust %.
This is not a deliberate choice: I needed a remainder operation with positive dividend and divisor. And because the interpreter is in Rust, using Rust's % for this operation was the easiest implementation that gave me what I wanted.
For the long term though, we should consider the alternative implementations. I found this blog post which has a survey of different implementations in different languages, and thoughts on which one should be used in new languages: https://julesjacobs.com/2023/09/23/on-div-and-mod.html.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
languageLanguage designLanguage design