why random(x) = 0..x?
Posted: Fri Oct 03, 2003 4:03 am
why random(x) = 0..x? that isn't 0..x-1?
random(x) for result in range 0..x-1 better 0..x:
random(x) for result in range 0..x-1 better 0..x:
http://www.purebasic.com
https://www.purebasic.fr/english/
Could be Blitz you're talking about.. it uses Rnd(from,to) for floating point values, and Rand(from,to) for integer values..freedimension wrote: I once had a language (don't remember which one) that had two commands for random-generation, one producing integers in a range of numbers and one producing random floats between 0 and 1. I believe they were called Random and Rand (or the other way round).
Noted for next doc update (v3.80)...blueznl wrote:it doesn't matter, as long as its properly docuemented: it generates a number from 0 to x (including 0 and x)... not BETWEEN those numbers
also, it generates an int...