[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Random number generation quirk
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: Random number generation quirk |
Date: |
Fri, 28 Feb 2014 12:14:08 -0500 |
On Fri, 2014-02-28 at 11:59 -0500, Michael Pender wrote:
> A few billion digits may not be enough to reproduce the problem if
> you are using rand(..., "double") which is the default. I found it
> happens more frequently when using rand(..., "single").
Ah, you're using single. I can reproduce now on 3.8.0:
octave:1> x = rand(3000,"single"); max(round(x*10+0.5)(:))
ans = 10
octave:2> x = rand(3000,"single"); max(round(x*10+0.5)(:))
ans = 11
octave:3> max(x(:))
ans = 1
This a bug one way or another, since the documentation clearly states
that this should not happen. Can you please file a bug report?
- Jordi G. H.