Talk:Pseudo-random numbers/PCG32: Difference between revisions

Content added Content deleted
Line 8: Line 8:
:Thanks Pete :-)
:Thanks Pete :-)
:--[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 05:19, 12 August 2020 (UTC)
:--[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 05:19, 12 August 2020 (UTC)

==Inappropriate masks?==
Python does not have an unsigned 64 bit integer type or an unsigned 32 bit integer type. It has an integer type whose size varies to accept its operators, and where appropriate, leading zeroes are dropped.

Most of these bit-twizzling algorithms are originally written in languages like C that have these types. To duplicate the calculations, the Python example may use 32 bit and 64 bit mask values. '''and'''ing a value with them will truncate that value to a maximum of 32/64 bits.

Fpr languages '''with''' these types, this '''would not''' be an idiomatic solution. Please use those types if they are a part of your language rather than follow the Python masking route, thanks. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 11:00, 13 August 2020 (UTC)