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

  1.  
  2. (* Arbitrary Precision Floating Point definition module. *)
  3.  
  4. DEFINITION MODULE MASAPF;
  5.  
  6.  
  7. (* Import lists and Definitions *) 
  8.  
  9. FROM MASSTOR IMPORT LIST;
  10.  
  11.  
  12. PROCEDURE APCOMP(ML,EL: LIST): LIST;
  13. (*Arbitrary precision floating point composition. e is the
  14. exponent, m is the mantissa of the arbitrary precision
  15. floating point number A.*)
  16.  
  17.  
  18. PROCEDURE APMANT(A: LIST): LIST;
  19. (*Arbitrary precision floating point mantissa. m is the mantissa 
  20. of the arbitrary precision floating point number A.*)
  21.       
  22.  
  23. PROCEDURE APEXPT(A: LIST): LIST;
  24. (*Arbitrary precision floating point exponent. e is the
  25. exponent of the arbitrary precision floating point number A.*)
  26.  
  27.  
  28. PROCEDURE ILOG10(N: LIST): LIST;
  29. (*Integer logarithm base 10.
  30. N is an integer, l is a beta integer. l=LOG10(ABS(N)).*)
  31.  
  32.  
  33. PROCEDURE APSPRE(N: LIST);
  34. (*Arbitrary precision floating point set precision.
  35. N is the desired precision of the floating point numbers.*)
  36.  
  37.  
  38. PROCEDURE APFINT(N: LIST): LIST;
  39. (*Arbitrary precision floating point from integer.
  40. The integer N is converted to the arbitrary precision
  41. floating point number A.*)
  42.  
  43.  
  44. PROCEDURE APSHFT(B,EL: LIST): LIST;
  45. (*Arbitrary precision floating point shift.
  46. The arbitrary precision floating point number B is multiplied by 2**e.
  47. A is an arbitrary precision floating point number.*)
  48.  
  49.  
  50. PROCEDURE APSIGN(A: LIST): LIST;
  51. (*Arbitrary precision floating point sign. A is an arbitrary precision 
  52. floating point number, s is the sign of A.*)
  53.  
  54.  
  55. PROCEDURE APWRIT(A: LIST);
  56. (*Arbitrary precision floating point write.
  57. The arbitrary precision floating point number A is written to
  58. the output stream.*)
  59.  
  60.  
  61. PROCEDURE APNEG(A: LIST): LIST;
  62. (*Arbitrary precision floating point negative.
  63. The arbitrary precision floating point number A is negated.
  64. B= -A.*)
  65.  
  66.  
  67. PROCEDURE APABS(A: LIST): LIST;
  68. (*Arbitrary precision floating point absolute value.
  69. A is a arbitrary precision floating point number.
  70. B is the absolute value of A.*)
  71.  
  72.  
  73. PROCEDURE APCMPR(A,B: LIST): LIST;
  74. (*Arbitrary precision floating point compare.
  75. A and B are arbitrary precision floating point numbers.
  76. s is the sign of the difference of A and B. s=SIGN(A-B).*)
  77.  
  78.  
  79. PROCEDURE APNELD(A,B: LIST): LIST;
  80. (*Arbitrary precision floating point number of equal leading digits.
  81. A and B are arbitrary precision floating point numbers.
  82. l is the number of equal leading digits of A and B.*)
  83.  
  84.  
  85. PROCEDURE APPROD(A,B: LIST): LIST;
  86. (*Arbitrary precision floating point product.
  87. A, B and C are arbitrary precision floating point numbers.
  88. C is the product of A and B. C=A*B.*)
  89.  
  90.  
  91. PROCEDURE APQ(A,B: LIST): LIST;
  92. (*Arbitrary precision floating point quotient.
  93. A, B and C are arbitrary precision floating point numbers.
  94. C is the quotient of A and B. C=A/B.*)
  95.  
  96.  
  97. PROCEDURE APSUM(A,B: LIST): LIST;
  98. (*Arbitrary precision floating point sum.
  99. A, B and C are arbitrary precision floating point numbers.
  100. C is the sum of A and B. C=A+B.*)
  101.  
  102.  
  103. PROCEDURE APDIFF(A,B: LIST): LIST;
  104. (*Arbitrary precision floating point difference.
  105. A, B and C are arbitrary precision floating point numbers.
  106. C is the difference of A and B. C=A-B.*)
  107.  
  108.  
  109. PROCEDURE APLG10(A: LIST): LIST;
  110. (*Arbitrary precision floating point logarithm base 10.
  111. A is an arbitrary precision floating point number,
  112. l is a beta integer, l=LOG10(ABS(A)). *)
  113.  
  114.  
  115. PROCEDURE APEXP(A,NL: LIST): LIST;
  116. (*Arbitrary precision floating point exponentiation.
  117. A and B are arbitrary precision floating point numbers.
  118. n is a beta-integer.  B=A**n.*)
  119.  
  120.  
  121. PROCEDURE APFRN(A: LIST): LIST;
  122. (*Arbitrary precision floating point from rational number.
  123. B is an arbitrary precision floating point number.
  124. A is a rational number.*)
  125.  
  126.  
  127. PROCEDURE RNFAP(A: LIST): LIST;
  128. (*Rational number from arbitrary precision floating point.
  129. A is an arbitrary precision floating point number.
  130. B is a rational number.*)
  131.  
  132.  
  133. PROCEDURE RNDRD(): LIST;
  134. (*Rational number decimal read.  The rational number R is read
  135. from the input stream.  Any preceding blanks are skipped.*)
  136.  
  137.  
  138. PROCEDURE APROOT(A,NL: LIST): LIST;
  139. (*Arbitrary precision floating point n-th root.
  140. A and B are arbitrary precision floating point numbers.
  141. B is the n-th root of A.*)
  142.  
  143.  
  144. PROCEDURE APPI(): LIST;
  145. (*Arbitrary precision floating point pi.
  146. pi is an arbitrary precision floating point number. *)
  147.  
  148.  
  149. END MASAPF.
  150.  
  151.  
  152.