Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WISH: Make MOD infix synonym for MODULO #2311

Closed
Siskin-Bot opened this issue Feb 15, 2020 · 0 comments
Closed

WISH: Make MOD infix synonym for MODULO #2311

Siskin-Bot opened this issue Feb 15, 2020 · 0 comments

Comments

@Siskin-Bot
Copy link
Collaborator

Submitted by: Hostilefork

In the math world, it is fairly ubiquitous that MOD is written between the numbers it operates on (n mod m):

https://en.wikipedia.org/wiki/Modulo_operation

That's also true of MODULO (n modulo m) but it seems fair in Rebol to let the longer word be prefix.

At time of writing MOD and MODULO are not quite the same, which is confusing. What would make more sense would be if mod were simply the infix form of modulo, and any deviations in behavior deemed necessary would come from a refinement or from using REMAINDER.


Imported from: metaeducation#2310

Comments:


Hostilefork added the Type.wish on Jun 11, 2018


Hostilefork commented on Oct 22, 2018:

It took a bit of study to figure out the significance of the difference between the existing MOD and MODULO constructs. The difference (which was whether or not values that were near zero were rounded to zero) was decided to be the "odd case" not matching behavior in most other languages, and hence is offered under an /ADJUSTED refinement:

metaeducation/ren-c#843

Note: Ren-C is able to use refinements with infix functions if the -> operator is used, e.g.

 5.4 -> mod/adjusted 10.2

Hostilefork added the Ren.resolved on Oct 22, 2018


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants