<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Il 05/04/2017 18:09, Bart ha scritto:<br>
</div>
<blockquote
cite="mid:CAMye31yP5OTP3xJ_bjbBD2Mtu5=_GQuTKNs-Zo9cEMU69_30rw@mail.gmail.com"
type="cite">
<pre wrap=""><a class="moz-txt-link-freetext" href="http://www.freepascal.org/docs-html/current/rtl/system/random.html">http://www.freepascal.org/docs-html/current/rtl/system/random.html</a>
"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.
</pre>
</blockquote>
<br>
My scant knowledge of English leads me to believe that the sentence
should be rephrased in order to cover the negative numbers case:<br>
<br>
either:<br>
<blockquote>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.<br>
</blockquote>
or:<br>
<blockquote>Random return a random number in the range 0 (included)
to L (excluded).<br>
</blockquote>
Just my 2c.<br>
<br>
Giuliano<br>
<br>
</body>
</html>