home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / misc / mas / mashelp / masrn.def < prev    next >
Encoding:
Modula Definition  |  1989-10-07  |  1.1 KB  |  46 lines

  1.  
  2. (* MAS Rational Number Definition Module. *)
  3.  
  4. DEFINITION MODULE MASRN;
  5.  
  6.  
  7. FROM MASSTOR IMPORT LIST;
  8.  
  9.  
  10. PROCEDURE RNDRD(): LIST; 
  11. (*Rational number decimal read.  The rational number R is read
  12. from the input stream.  Any preceding blanks are skipped.*)
  13.  
  14.  
  15. PROCEDURE RNDWR(R,NL: LIST); 
  16. (*Rational number decimal write.  R is a rational number.  n is a
  17. non-negative integer.  R is approximated by a decimal fraction D with
  18. n decimal digits following the decimal point and D is written in the
  19. output stream.  The inaccuracy of the approximation is at most
  20. (1/2)*10**-n. *)
  21.  
  22.  
  23. PROCEDURE RNDWRS(A,S: LIST); 
  24. (*Rational number decimal write special.
  25. Call RNDWR. *)
  26.  
  27.  
  28. PROCEDURE RNEXP(A,NL: LIST): LIST; 
  29. (*Rational number exponentiation.  A is a rational number,
  30. n is a non-negative beta-integer.  B=A**n.*)
  31.  
  32.  
  33. PROCEDURE RNMAX(AL,BL: LIST): LIST; 
  34. (*Rational number maximum.  a and b are rational numbers.
  35. c is the maximum of a and b.*)
  36.  
  37.  
  38. PROCEDURE RNONE(R: LIST): LIST; 
  39. (*Rational number one.  R is a rational number.  s=1 if R=1,
  40. s=0 else. *)
  41.  
  42.  
  43. END MASRN.
  44.  
  45.  
  46.