octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #41742] The rand function occasionally returns


From: Philipp Kutin
Subject: [Octave-bug-tracker] [bug #41742] The rand function occasionally returns unexpected results.
Date: Mon, 17 Mar 2014 20:22:29 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0

Follow-up Comment #1, bug #41742 (project octave):

This is fixed with patch #8389. As per jwe's recommendation, I'm re-attaching
it here once more. A bit of discussion is available in the mailing list
archives:
http://octave.1599824.n4.nabble.com/Re-Random-number-generation-quirk-td4662514.html
. Opinions?

Specifically, can the fact that randu32() makes the underlying generator skip
values be a problem? I can't come up with good arguments either for or
against, but to me it seems better than "compressing" 0:2^32-1 to [0+small1,
1-small2]. By multiplying 2^-32 with integers, it's at least possible to state
(say, with a short mathematical expression) which numbers are sampled at all.
That doesn't seem so straightforward with the current code (or, rather "the
code that uses the same idea as the current one, but is correct").

(file #30931)
    _______________________________________________________

Additional Item Attachment:

File name: randu32_no_exact_1.patch       Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?41742>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]