[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Updated modules
> A new module has also been uploaded which implements arbitrary-precision
> integers which has a similar interface to the module also being provided
> with the Oberon-F compiler.
There has been some confusion over the two integer math modules which
were placed on the cognac site. Please DO NOT use the LongInt module.
It is being used to support some of the other library modules and is
really limited in what it can do.
The true arbitrary-precision integer package everyone can use is the
Integers.Mod file (part of the recent OOC library files distribution).
It has the following complete interface:
--------------------------------------------------------------------
MODULE Integers;
TYPE
Integer = POINTER TO IntegerDesc;
VAR
ONE-: Integer;
ZERO-: Integer;
PROCEDURE Abs (x: Integer): Integer;
PROCEDURE Compare (x: Integer; y: Integer): LONGINT;
PROCEDURE ConvertFromString (s: ARRAY OF CHAR; VAR x: Integer; base: SHORTINT);
PROCEDURE ConvertToInteger (x: ARRAY OF SET): Integer;
PROCEDURE ConvertToSet (x: ARRAY OF INTEGER; VAR s: ARRAY OF SET);
PROCEDURE ConvertToString (x: Integer; VAR s: ARRAY OF CHAR; base: SHORTINT);
PROCEDURE Difference (x: Integer; y: Integer): Integer;
PROCEDURE Digits10Of (x: Integer): LONGINT;
PROCEDURE Entier (x: LONGREAL): Integer;
PROCEDURE Factorial (x: LONGINT): Integer;
PROCEDURE Float (x: Integer): LONGREAL;
PROCEDURE GCD (x: Integer; y: Integer): Integer;
PROCEDURE Long (x: LONGINT): Integer;
PROCEDURE Odd (x: Integer): BOOLEAN;
PROCEDURE Power (x: Integer; exp: LONGINT): Integer;
PROCEDURE Product (x: Integer; y: Integer): Integer;
PROCEDURE QuoRem (x: Integer; y: Integer; VAR quo: Integer; VAR rem: Integer);
PROCEDURE Quotient (x: Integer; y: Integer): Integer;
PROCEDURE Random (digits: LONGINT): Integer;
PROCEDURE Remainder (x: Integer; y: Integer): Integer;
PROCEDURE Shift (x: Integer; exp: LONGINT): Integer;
PROCEDURE Short (x: Integer): LONGINT;
PROCEDURE Sign (x: Integer): SHORTINT;
PROCEDURE Sum (x: Integer; y: Integer): Integer;
PROCEDURE ThisDigit10 (x: Integer; exp10: LONGINT): CHAR;
END Integers.
--------------------------------------------------------------------
Sorry about the confusion.
Michael Griebling