-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Closed
Description
In random/src/pcg64/pcg64.c, uint128 version (PCG_EMULATED_128BIT_MATH
disabled) performs:
delta /= 2;
uint64+64 version (PCG_EMULATED_128BIT_MATH
enabled) emulates it with manual delta >>= 1
ing:
delta.low >>= 1;
delta.low += delta.high & 1;
delta.high >>= 1;
This is obviously incorrect and will screw up jumps by 264 or more (those with delta.high != 0
). Must be rather:
delta.low = (delta.low >> 1) | (delta.high << 63);
delta.high >>= 1;
Metadata
Metadata
Assignees
Labels
No labels