Re-enable deftransform for random integers
Describe the bug
We have a deftransform
for word-sized random
integers. This was used for the
MT19937 generator. I think we forgot about this when we implemented
the xoroshiro generator.
We can see this if we place this code in a file and compile it to produce a trace file:
(defun zot ()
(random 100000))
To Reproduce
Steps to reproduce the behavior:
- Compile the above code with
:trace-file t
- Look at the trace file. You can see a call to
truncate
.
Expected behavior
We should be doing a multiply instead of a truncate. Note also that
this is a bug in that random
uses a
multiplication. We need to be
consistent between the two code paths. I guess in practice, this is
not so easy to see, but we could probably create a simple test for
this.
Desktop (please complete the following information):
- OS: All
- Version: Any version after xoroshiro was implemented.