home *** CD-ROM | disk | FTP | other *** search
- unit Numeric;
-
- { Version 4.2
- (c) 1993 by
- Jochen Göttler
- Im Dellbrunnen 6
- D-66954 Pirmasens
- Tel: 06331/92788
- Fax: 06331/93620
- }
-
- {$A+,B-,D-,F-,I-,L-,O-,R-,S-,V-,X-}
-
-
- interface
-
-
- const MaxWord = 65535;
- MaxNumLength = 17;
- { Maximale Länge einer Zahlenausgabe }
-
- {$IFOPT N-}
-
- epsilon: Real = 1E-9;
- Unendlich: Real = 1E9;
- MaxReal = 1.7E38;
- MaxFacArg = 33;
- ExpLength = 3;
- { Exponentenlänge }
- MaxRatDLength: Byte = 11;
- { Maximale Dezimalstellenlänge, Standardformat }
-
- {$ELSE}
-
- epsilon: Extended = 1E-13;
- Unendlich: Extended = 1E13;
- MaxReal = 1.1E4932;
- MaxFacArg = 1754;
- ExpLength = 5;
- MaxRatDLength: Byte = 18;
-
- type Real = Extended;
-
- {$ENDIF}
-
- const Error: Byte = 0;
- { Liefert bei undef. math. Operation Wert 128 }
- MaxExponDLength: Byte = 10;
- { Maximale Dezimalstellenlänge, Exponentialformat }
- MinRatDLength = 0;
- MinExponDLength = 1;
- ExponFLength = 4+ExpLength;
-
- var e, piDiv180, piHalbe: Real;
- { Eulersche Konstante, pi/180, pi/2 }
- MaxRat: Real;
- { Maximale nicht-exponentiell darstellbare Zahl }
- MaxExp, MinExp: Integer;
- { Maximaler/Minimaler Exponent }
-
- function Minus (x1, x2: Word): Word;
- { Liefert x1-x2 für x1>x2, ansonsten 0 }
- function CTrunc (x: Real): LongInt;
- { Absicherung gegen |x|>MaxLongInt -> Error:=128 }
- function CTruncI (x: Real): Integer;
- function CRound (x: Real): LongInt;
- function CRandom (x: Real): LongInt;
- function Floor (x: Real): LongInt;
- { Nächstkleinere ganze Zahl }
- function Ceiling (x: Real): LongInt;
- { Nächstgrößere ganze Zahl }
- function Full (x: Real): Real;
- {
- x<0: Full(x):=Floor(x)
- x>=0: Full(x):=Ceiling(x)
- }
- function Exponent (r: Real): Integer;
- function Mantisse (r: Real): Real;
- function Decimals (r: Real; f: Boolean): Word;
- {
- Liefert die Anzahl gültiger Nachkommastellen von r.
- Für f=FALSE ist die Exponentialform von r Grundlage.
- }
- function IsInteger (x: Real): Boolean;
- function IsIntegerC(x: Real): Boolean;
- { TRUE für x Ganzzahl und |x|<=MaxLongInt }
- function NumStr (r: Real): String;
- function NullStr (n: LongInt; l: Byte): String;
- { Konvertiert n in String der Länge l mit führenden Nullen }
- function CDiv (x1, x2: Real): Real;
- { Absicherung gegen Division durch Null -> Error:=128 }
- function CIDiv (x1, x2: LongInt): LongInt;
- { Abgesicherte Integer-Division }
- function CMod (x1, x2: LongInt): LongInt;
- function CSqrt (x: Real): Real;
- function Power (x1, x2: Real): Real;
- function Exd (e: Integer): Real;
- { f(e)=10^e }
- function Log (b, x: Real): Real;
- function Lg (x: Real): Real;
- { Logarithmus zur Basis 10 }
- function Ld (x: Real): Real;
- { Logarithmus zur Basis 2 }
- function CLn (x: Real): Real;
- function Sgn (x: Real): ShortInt;
- function Tan (x: Real): Real;
- function Cot (x: Real): Real;
- function Sec (x: Real): Real;
- function Csc (x: Real): Real;
- function ASin (x: Real): Real;
- function ACos (x: Real): Real;
- function ACot (x: Real): Real;
- function ASec (x: Real): Real;
- function ACsc (x: Real): Real;
- function SinH (x: Real): Real;
- function CosH (x: Real): Real;
- function TanH (x: Real): Real;
- function CotH (x: Real): Real;
- function SecH (x: Real): Real;
- function CscH (x: Real): Real;
- function ASinH (x: Real): Real;
- function ACosH (x: Real): Real;
- function ATanH (x: Real): Real;
- function ACotH (x: Real): Real;
- function ASecH (x: Real): Real;
- function ACscH (x: Real): Real;
- function Fac (x: Real): Real;
- function BinKoeff (x, y: Real): Real;
- function Deg (x: Real): Real;
- function Rad (x: Real): Real;
- function DecConv (d: LongInt; b: Byte): String;
- {
- Umwandlung Dezimalsystem -> b-System
- }
- function ConvDec (s: String; b: Byte): LongInt;
- {
- Umwandlung b-System -> Dezimalsystem
- }
- function Conv (s: String; b1, b2: Byte): String;
- {
- Umwandlung b1-System -> b2-System
- }
- function LoNibble (x: Byte): Byte;
- function HiNibble (x: Byte): Byte;
- procedure SwapByte (var x, y: Byte);
- procedure SwapWord (var x, y: Word);
- procedure SwapShortInt (var x, y: ShortInt);
- procedure SwapInteger (var x, y: Integer);
- procedure SwapLongInt (var x, y: LongInt);
- procedure SwapReal (var x, y: Real);
- procedure SwapBoolean (var x, y: Boolean);
- procedure IncReal (var x: Real; y: Real);
- procedure DecReal (var x: Real; y: Real);
- function MaxOfByte (x, y: Byte): Byte;
- function MaxOfWord (x, y: Word): Word;
- function MaxOfShortInt (x, y: ShortInt): ShortInt;
- function MaxOfInteger (x, y: Integer): Integer;
- function MaxOfLongInt (x, y: LongInt): LongInt;
- function MaxOfReal (x, y: Real): Real;
- function MinOfByte (x, y: Byte): Byte;
- function MinOfWord (x, y: Word): Word;
- function MinOfShortInt (x, y: ShortInt): ShortInt;
- function MinOfInteger (x, y: Integer): Integer;
- function MinOfLongInt (x, y: LongInt): LongInt;
- function MinOfReal (x, y: Real): Real;
-
-
- end.
-