Janilabo

Janilabo | InRangeE() [SCAR Divi]

May 8th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.59 KB | None | 0 0
  1. {==============================================================================]  
  2.   Explanation: Returns true if value is equal-to/between minimum and maximum.                  
  3. [==============================================================================}
  4. function InRangeE(value, minimum, maximum: Extended): Boolean;
  5. begin
  6.   Result := ((value >= minimum) and (value <= maximum));
  7. end;
  8.  
  9. begin
  10.   ClearDebug;
  11.   if InRangeE(124, 124, 125) then
  12.     WriteLn('YES!');
  13.   if InRangeE(124.999, 124, 125) then
  14.     WriteLn('YES!');
  15.   if InRangeE(125.001, 124, 125) then
  16.     WriteLn('WTF?');
  17. end.
Advertisement
Add Comment
Please, Sign In to add comment