diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-10-07 01:21:08 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-10-07 01:21:08 -0700 |
commit | 21e158606061246c7fcabb07b18bc5bc2f001054 (patch) | |
tree | 3aa07550d6be2de9d258e8079303db734894eafa /gc.h | |
parent | acf39f8972db8171e4be60fc569f325fce64458f (diff) | |
download | txr-21e158606061246c7fcabb07b18bc5bc2f001054.tar.gz txr-21e158606061246c7fcabb07b18bc5bc2f001054.tar.bz2 txr-21e158606061246c7fcabb07b18bc5bc2f001054.zip |
random: bugfix: incorrect WELL512a.
* rand.c (rand32_bug): New static function formed by
renaming the original buggy rand32.
(rand32_good): Copy of rand32 with two bugfixes. The term
involving variable r2 must be only left shifted by 28 bits,
and not xor-ed with the original value. The order of
operations is wrong in the term that contains the & operation.
(rand32): New static function pointer variable, serving
as the rand32 function. Points to rand32_good by default.
(rand_compat_fixup): Test for 243 or lower compatibility,
under which rand32 is made point to rand32_bug. This is done
before the call to make_random_state for replacing
*random-state*, which has to use the old function.
* txr.1: compat note added.
* tests/013/maze.expected: Updated.
Diffstat (limited to 'gc.h')
0 files changed, 0 insertions, 0 deletions