{ DL-Pascal Unit Interface: MathTools } { Compile this first -> produces MATHTOOL.UNI } { Then compile MATHTOOL.PAS -> produces MATHTOOL.OLE } INTERFACE MathTool; CONST UT_VERSION = 10; UT_PI = 3.14159265358979; TYPE TStats = RECORD count : Integer; sum : LongInt; min : Integer; max : Integer; END; VAR CallCount : Integer; PROCEDURE UTReset; FUNCTION UTAdd(a, b : Integer) : Integer; FUNCTION UTMul(a, b : Integer) : LongInt; FUNCTION UTMax(a, b : Integer) : Integer; FUNCTION UTMin(a, b : Integer) : Integer; FUNCTION UTAbs(n : Integer) : Integer; FUNCTION UTIsPrime(n : Integer) : Boolean; FUNCTION UTFactorial(n : Integer) : LongInt; FUNCTION UTGcd(a, b : Integer) : Integer; PROCEDURE UTInitStats(VAR st : TStats); PROCEDURE UTAddStat(VAR st : TStats; val : Integer); FUNCTION UTMean(VAR st : TStats) : Real; END.