I love these topics.
Under 64 bits:
Math.InRange: 859
IsInRange: 858
If: 860
IsInRangeEx: 858
IsInRangeEx2: 858
Under 32bits:
Math.InRange: 1288
IsInRange: 906
If: 906
IsInRangeEx: 858
IsInRangeEx2: 858
The code for IsInRangeEx and isInRangeEx2:
function IsInRangeEx(const AValue, AMin, AMax: Cardinal): Boolean; inline;
begin
Result := (AValue - AMin) <= (aMax - aMin);
end;
function IsInRangeEx2(const AValue, AMin, AMax: Integer): Boolean; inline;
begin
Result := ((AValue-AMax)*(aValue-AMin) <= 0);
end;