home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 138 / pascal / max.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1987-05-13  |  564 b   |  47 lines

  1. {
  2.  
  3.    Function Max_int accepts two integers as arguments and returns
  4.    the larger of the two.
  5.  
  6. }
  7.  
  8. function
  9. MAX_INT(
  10.             x,
  11.             y  : real
  12.        );
  13.  
  14.  
  15. BEGIN {MAX_INT}
  16.  
  17. If x > y then
  18.    Max_Int := x
  19. Else
  20.    Max_Int := y
  21.  
  22. END; {MAX_INT}
  23.  
  24.  
  25. {
  26.  
  27.    Function Max_Real accepts two real numbers as parameters and
  28.    returns the greater of the two.
  29.  
  30. }
  31.  
  32. function
  33. MAX_REAL(
  34.              x,
  35.              y   : real
  36.         );
  37.  
  38.  
  39. BEGIN {MAX_REAL}
  40.  
  41. If x > y then
  42.    Max_Real := x
  43. Else
  44.    Max_Real := y
  45.  
  46. END; {MAX_REAL}
  47.