Author Topic: RND Question  (Read 3712 times)

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
RND Question
« on: November 25, 2005, 05:41:58 PM »
Sorry to sound a thickie, but can someone confirm the following:-

If I use 3 RND, I should expect a result of 1, 2 or 3.
A decimal isn't returned, nor is 0.

The reason I ask is because some languages can include 0 as an option.
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
RND Question
« Reply #1 on: November 25, 2005, 05:54:48 PM »
Don't worry problem solved.

An integer is returned and the value can include 0.
So 3 RND will produce 0, 1, 2 and 3.
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
RND Question
« Reply #2 on: November 25, 2005, 05:56:50 PM »
I believe value rnd will produce a value in the interval [0, value]

This may also work for negative values, but I haven't tried it yet.