Skip to content

Commit

Permalink
Fix RandomMean
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Jan 4, 2025
1 parent aa51da0 commit b46dbb5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Source/simba.random.pas
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,7 @@ function RandomRight(Lo, Hi: Int64): Int64;

function RandomMean(Lo, Hi: Double): Double;
begin
if (Random() < 0.50) then
Result := (Hi+Lo) / 2.0 + RandomLeft(0, (Hi-Lo) / 2)
else
Result := (Hi+Lo) / 2.0 - RandomLeft(0, (Hi-Lo) / 2);
Result := RandomMode(Lo + ((Hi-Lo) / 2), Lo, Hi);
end;

function RandomMean(Lo, Hi: Int64): Int64;
Expand Down

0 comments on commit b46dbb5

Please sign in to comment.