Random<int64_t>() only returns 32 bit values
Summary
Random function for 64 bit integers does not return "uniformly spread numbers" as it is documented to. The function (https://gitlab.com/libeigen/eigen/-/blob/master/Eigen/src/Core/MathFunctions.h?ref_type=heads#L799) is limited by the value of RAND_MAX, which is typically INT_MAX and gives only 31-bits of entropy.
Environment
- Operating System : Linux
- Architecture : Any
- Eigen Version : head
- Compiler Version : Any
- Compile Flags : Any
- Vector Extension : Any
Steps to reproduce
- Generate a lot of "random" 64-bit numbers.
- Observe them to be all smaller than 2^32.
What is the current bug behavior?
Generated numbers have all high bits set to zero.
What is the expected correct behavior?
Generated numbers should be uniformly distributed throughout the value space.