Handlebars.Net.Helpers icon indicating copy to clipboard operation
Handlebars.Net.Helpers copied to clipboard

Wiki Documentation for Math.Modulo is incorrect

Open greyknight79 opened this issue 9 months ago • 1 comments

https://github.com/Handlebars-Net/Handlebars.Net.Helpers/wiki/Math#mod Incorrectly calls the operator Mod when it is in fact Modulo

greyknight79 avatar Apr 10 '25 21:04 greyknight79

@greyknight79

You mean:

That the method is called Mod and actually uses % which is actually the remainder.

int a = 10;
int b = 3;
int result = a % b; // result is 1 because 10 divided by 3 is 3 with a remainder of 1

and

int a = -10;
int b = 3;
int result = a % b; // result is -1 because the sign follows the dividend (-10)

Where Modulo always returns positive?

StefH avatar Apr 11 '25 06:04 StefH