Talk:Pseudo-random numbers/Combined recursive generator MRG32k3a: Difference between revisions

From Rosetta Code
Content added Content deleted
 
Line 1: Line 1:
==Modulo strikes again==
==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 different output than Python when using the latter type of modulo operator. I'm getting the same output as Python when I use a modulo function that always returns positive results. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 10:35, 14 August 2020 (UTC)
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 different output than Python when using the latter type of modulo operator. I'm getting the same output as Python when I use a modulo function that always returns positive results. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 10:35, 14 August 2020 (UTC)

Oh. I've learnt something more, thanks. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 13:10, 16 August 2020 (UTC)

Latest revision as of 13:10, 16 August 2020

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 different output than Python when using the latter type of modulo operator. I'm getting the same output as Python when I use a modulo function that always returns positive results. --Chunes (talk) 10:35, 14 August 2020 (UTC)

Oh. I've learnt something more, thanks. --Paddy3118 (talk) 13:10, 16 August 2020 (UTC)