[fpc-devel] Different results of random(int32) and random(int64) for negative limit value

Jonas Maebe jonas at freepascal.org
Sat May 20 14:57:58 CEST 2017

On 20/05/17 14:36, Martin Schreiber wrote:
> Is this intended? If not, which one is correct?

random(x) is undefined for negative parameters. It should have had an 
unsigned parameter, like in Turbo Pascal (where it is word). Delphi 
defines it as always returning a positive value, but I don't know what 
happens if you pass a negative parameter there.


More information about the fpc-devel mailing list