Open karlra opened 6 years ago
I see the discussion in the manual about system generators being in the range [0, int.MaxValue] and that you could use NextFullRangeInt32(), but that has no range parameter. So it is not possible to generate an int in a range larger than half the int range, but within a specific range?
The sixth overload of MathNet.Numerics.Random.MersenneTwister.Default.NextInt32s has the signature:
The method says it should returned signed integers, so one would expect it to work in the range int.MinValue to int.MaxValue. Calling it like this works:
Calling it like this works too:
However, increasing the range by 1 by setting the second parameter to -2 instead gives the exception
It seems that whenever you make the range of integers larger than abs(int.MinValue) then you get the above exception.
I'm pretty new to this library, am I misunderstanding something? Is the range of possible values actually only half of the int range? I'm using this in .net core 2.0, could that have anything to do with it? I haven't run into any other issues like this and everything seems to work otherwise.