Home   Help Search Login Register  

Author Topic: OpFl random number generator details details details..  (Read 441 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
A comment on the true range of the Random command would be useful.

e.g.
Random 1 generates a number from 0 to 1 but:

Is it 0 to 1 both inclusive, 0 inclusive to 1 exclusive, 0 exclusive to 1 inclusive, or 0 to 1 both exclusive. The difference can sometimes be critical.

Does anyone know the answer to this?
urp!

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:OpFl random number generator details details details..
« Reply #1 on: 09 Dec 2004, 23:29:24 »
Just tested it with script. It doesn't seem to happen 1 time in 100,000 even, not with 1 or 0. For a guess I would say it is exclusive?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:OpFl random number generator details details details..
« Reply #2 on: 09 Dec 2004, 23:43:58 »
I disagree.......I believe it will return a number between 0 and 1, both numbers being inclusive.


Planck
I know a little about a lot, and a lot about a little.

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:OpFl random number generator details details details..
« Reply #3 on: 10 Dec 2004, 05:44:08 »
*Does U-turn*

OK, you right.
Considering the accuracy of the output is 6 DP (by hint format), i assume that means 1,000,001 possible outputs if you include 0 and 1, each with the same probability. My 100,000 test was probably not likely to yield a 0.000 000 or 1.000 000. Searching the interweb confirms range [0,1]