core-lang / core

The Core Programming Language
https://core-lang.dev
MIT License
45 stars 1 forks source link

drop `%` operator, rename function from `modulo` to `remainder` #51

Closed soc closed 1 year ago

soc commented 1 year ago

Most languages call % "modulo", but implement it as a remainder operation.

Considering that we seem to have at least 4 different definitions of %¹², drop the operator and use function names instead.


¹ Boute, Raymond T. (April 1992). "The Euclidean definition of the functions div and mod". ACM Transactions on Programming Languages and Systems. ACM Press (New York, NY, USA). 14 (2): 127–144. doi:10.1145/128861.128862.

² Leijen, Daan (December 3, 2001). "Division and Modulus for Computer Scientists"