Computes the true mathematical modulo of two JS standard numbers, ensuring a non-negative result.
Parameters
n: number
The dividend.
m: number
The divisor (must be a positive, non-zero number).
Returns number
The positive remainder representing n mod m.
Remarks
In standard JavaScript, the % operator computes the remainder, which can result in a negative
number if the dividend n is negative. This helper function corrects that behavior to return
a mathematically sound positive modulo in the range [0, m).
Computes the true mathematical modulo of two JS standard
numbers, ensuring a non-negative result.