
(* Arbitrary Precision Floating Point definition module. *)

DEFINITION MODULE MASAPF;


(* Import lists and Definitions *) 

FROM MASSTOR IMPORT LIST;


PROCEDURE APCOMP(ML,EL: LIST): LIST;
(*Arbitrary precision floating point composition. e is the
exponent, m is the mantissa of the arbitrary precision
floating point number A.*)


PROCEDURE APMANT(A: LIST): LIST;
(*Arbitrary precision floating point mantissa. m is the mantissa 
of the arbitrary precision floating point number A.*)
      

PROCEDURE APEXPT(A: LIST): LIST;
(*Arbitrary precision floating point exponent. e is the
exponent of the arbitrary precision floating point number A.*)


PROCEDURE ILOG10(N: LIST): LIST;
(*Integer logarithm base 10.
N is an integer, l is a beta integer. l=LOG10(ABS(N)).*)


PROCEDURE APSPRE(N: LIST);
(*Arbitrary precision floating point set precision.
N is the desired precision of the floating point numbers.*)


PROCEDURE APFINT(N: LIST): LIST;
(*Arbitrary precision floating point from integer.
The integer N is converted to the arbitrary precision
floating point number A.*)


PROCEDURE APSHFT(B,EL: LIST): LIST;
(*Arbitrary precision floating point shift.
The arbitrary precision floating point number B is multiplied by 2**e.
A is an arbitrary precision floating point number.*)


PROCEDURE APSIGN(A: LIST): LIST;
(*Arbitrary precision floating point sign. A is an arbitrary precision 
floating point number, s is the sign of A.*)


PROCEDURE APWRIT(A: LIST);
(*Arbitrary precision floating point write.
The arbitrary precision floating point number A is written to
the output stream.*)


PROCEDURE APNEG(A: LIST): LIST;
(*Arbitrary precision floating point negative.
The arbitrary precision floating point number A is negated.
B= -A.*)


PROCEDURE APABS(A: LIST): LIST;
(*Arbitrary precision floating point absolute value.
A is a arbitrary precision floating point number.
B is the absolute value of A.*)


PROCEDURE APCMPR(A,B: LIST): LIST;
(*Arbitrary precision floating point compare.
A and B are arbitrary precision floating point numbers.
s is the sign of the difference of A and B. s=SIGN(A-B).*)


PROCEDURE APNELD(A,B: LIST): LIST;
(*Arbitrary precision floating point number of equal leading digits.
A and B are arbitrary precision floating point numbers.
l is the number of equal leading digits of A and B.*)


PROCEDURE APPROD(A,B: LIST): LIST;
(*Arbitrary precision floating point product.
A, B and C are arbitrary precision floating point numbers.
C is the product of A and B. C=A*B.*)


PROCEDURE APQ(A,B: LIST): LIST;
(*Arbitrary precision floating point quotient.
A, B and C are arbitrary precision floating point numbers.
C is the quotient of A and B. C=A/B.*)


PROCEDURE APSUM(A,B: LIST): LIST;
(*Arbitrary precision floating point sum.
A, B and C are arbitrary precision floating point numbers.
C is the sum of A and B. C=A+B.*)


PROCEDURE APDIFF(A,B: LIST): LIST;
(*Arbitrary precision floating point difference.
A, B and C are arbitrary precision floating point numbers.
C is the difference of A and B. C=A-B.*)


PROCEDURE APLG10(A: LIST): LIST;
(*Arbitrary precision floating point logarithm base 10.
A is an arbitrary precision floating point number,
l is a beta integer, l=LOG10(ABS(A)). *)


PROCEDURE APEXP(A,NL: LIST): LIST;
(*Arbitrary precision floating point exponentiation.
A and B are arbitrary precision floating point numbers.
n is a beta-integer.  B=A**n.*)


PROCEDURE APFRN(A: LIST): LIST;
(*Arbitrary precision floating point from rational number.
B is an arbitrary precision floating point number.
A is a rational number.*)


PROCEDURE RNFAP(A: LIST): LIST;
(*Rational number from arbitrary precision floating point.
A is an arbitrary precision floating point number.
B is a rational number.*)


PROCEDURE RNDRD(): LIST;
(*Rational number decimal read.  The rational number R is read
from the input stream.  Any preceding blanks are skipped.*)


PROCEDURE APROOT(A,NL: LIST): LIST;
(*Arbitrary precision floating point n-th root.
A and B are arbitrary precision floating point numbers.
B is the n-th root of A.*)


PROCEDURE APPI(): LIST;
(*Arbitrary precision floating point pi.
pi is an arbitrary precision floating point number. *)


END MASAPF.


