mirror of
https://github.com/vapaamies/KolibriOS.git
synced 2025-02-03 01:22:07 +01:00
Random function bugfix © 0CodErr
This commit is contained in:
parent
b52068a7f2
commit
e4a5b1e0a6
@ -149,7 +149,7 @@ var
|
|||||||
RandSeed: LongWord;
|
RandSeed: LongWord;
|
||||||
RandCounter: LongWord;
|
RandCounter: LongWord;
|
||||||
|
|
||||||
function _RandInt(Range: LongWord): LongWord;
|
function _RandInt(Range: LongInt): LongInt;
|
||||||
function _RandExt: Extended;
|
function _RandExt: Extended;
|
||||||
procedure Randomize;
|
procedure Randomize;
|
||||||
|
|
||||||
@ -338,14 +338,14 @@ asm
|
|||||||
ADD EAX, MinValue
|
ADD EAX, MinValue
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function _RandInt(Range: LongWord): LongWord;
|
function _RandInt(Range: LongInt): LongInt;
|
||||||
begin
|
begin
|
||||||
Result := RandInt(0, Range - 1);
|
Result := RandInt(0, Range - 1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function _RandExt: Extended;
|
function _RandExt: Extended;
|
||||||
begin
|
begin
|
||||||
Result := 1 / RandInt(2, $FFFFFFFF);
|
Result := RandInt(0, $FFFFFFFE) / $FFFFFFFF;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Randomize;
|
procedure Randomize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user