diff --git a/RTL/System.pas b/RTL/System.pas index 2c17b0b..5e796b2 100644 --- a/RTL/System.pas +++ b/RTL/System.pas @@ -149,7 +149,7 @@ var RandSeed: LongWord; RandCounter: LongWord; -function _RandInt(Range: LongWord): LongWord; +function _RandInt(Range: LongInt): LongInt; function _RandExt: Extended; procedure Randomize; @@ -338,14 +338,14 @@ asm ADD EAX, MinValue end; -function _RandInt(Range: LongWord): LongWord; +function _RandInt(Range: LongInt): LongInt; begin Result := RandInt(0, Range - 1); end; function _RandExt: Extended; begin - Result := 1 / RandInt(2, $FFFFFFFF); + Result := RandInt(0, $FFFFFFFE) / $FFFFFFFF; end; procedure Randomize;