
On Do, 2016-01-21 at 09:38 +0000, Robert Kern wrote:
On Tue, Jan 19, 2016 at 5:35 PM, Sebastian Berg < sebastian@sipsolutions.net> wrote:
On Di, 2016-01-19 at 16:28 +0000, G Young wrote:
In rand range, it raises an exception if low >= high.
I should also add that AFAIK enforcing low >= high with floats is
a
lot trickier than it is for integers. I have been knee-deep in corner cases for some time with randint where numbers that are visually different are cast as the same number by numpy due to rounding and representation issues. That situation only gets worse with floats.
Well, actually random.uniform docstring says:
Get a random number in the range [a, b) or [a, b] depending on rounding.
Which docstring are you looking at? The current one says [low, high)
Sorry, I was referring to the python random.uniform function. And as far as I now understand the current numpy equivalent (intentionally or not) seems to do the same thing, which suits fine with me. - Sebastian
http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.unif orm.html#numpy.random.uniform
-- Robert Kern _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion