[fpc-pascal] Bug in documentation for Random?

Bart bartjunk64 at gmail.com
Wed Apr 5 18:09:16 CEST 2017


http://www.freepascal.org/docs-html/current/rtl/system/random.html

"Random returns a random number larger or equal to 0 and strictly less than L"

However random(a negative number) returns a number <= 0 and > L


program r;
begin
  randomize;
  writeln('Random(-10) = ',Random(-10));
end.

C:\Users\Bart\LazarusProjecten>test
random(-10) = -1
C:\Users\Bart\LazarusProjecten>test
random(-10) = -4

Maybe my understanding of English ("strictly less than") is not
correct, so I ask here before posting as a bugreport.

Bart



More information about the fpc-pascal mailing list