[fpc-pascal] Bug in documentation for Random?
giuliano.colla at fastwebnet.it
Wed Apr 5 18:46:38 CEST 2017
Il 05/04/2017 18:09, Bart ha scritto:
> "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;
> writeln('Random(-10) = ',Random(-10));
> random(-10) = -1
> random(-10) = -4
> Maybe my understanding of English ("strictly less than") is not
> correct, so I ask here before posting as a bugreport.
My scant knowledge of English leads me to believe that the sentence
should be rephrased in order to cover the negative numbers case:
Random return a random number with the same sign of L, and whose
absolute value is larger or equal to zero and strictly less than the
absolute value of L.
Random return a random number in the range 0 (included) to L (excluded).
Just my 2c.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal