Talk:Pseudo-random numbers/Combined recursive generator MRG32k3a

From Rosetta Code
Revision as of 10:35, 14 August 2020 by Chunes (talk | contribs) (modulo operator)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Modulo strikes again

Just a heads up: Python (the reference implementation) is one of those languages whose modulo operator returns the same sign as the divisor. In most languages, the modulo operator returns the same sign as the dividend. You'll get incorrect output when using the latter type of modulo operator. I'm getting correct output when I use a modulo function that always returns positive results. --Chunes (talk) 10:35, 14 August 2020 (UTC)