You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
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 ofmodulo
, and any deviations in behavior deemed necessary would come from a refinement or from using REMAINDER.Imported from: metaeducation#2310
Comments:
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.
The text was updated successfully, but these errors were encountered: