home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xco212p.zip / ISODEF / longcomp.def < prev    next >
Text File  |  1994-12-22  |  2KB  |  63 lines

  1. DEFINITION MODULE LongComplexMath;
  2.  
  3.   (* Mathematical functions for the type LONGCOMPLEX *)
  4.  
  5. CONST
  6.   i =    CMPLX (0.0, 1.0);
  7.   one =  CMPLX (1.0, 0.0);
  8.   zero = CMPLX (0.0, 0.0);
  9.  
  10. PROCEDURE abs (z: LONGCOMPLEX): LONGREAL;
  11.   (* Returns the length of z *)
  12.  
  13. PROCEDURE arg (z: LONGCOMPLEX): LONGREAL;
  14.   (* Returns the angle that z subtends to the positive real axis *)
  15.  
  16. PROCEDURE conj (z: LONGCOMPLEX): LONGCOMPLEX;
  17.   (* Returns the complex conjugate of z *)
  18.  
  19. PROCEDURE power (base: LONGCOMPLEX; exponent: LONGREAL): LONGCOMPLEX;
  20.   (* Returns the value of the number base raised to the power exponent *)
  21.  
  22. PROCEDURE sqrt (z: LONGCOMPLEX): LONGCOMPLEX;
  23.   (* Returns the principal square root of z *)
  24.  
  25. PROCEDURE exp (z: LONGCOMPLEX): LONGCOMPLEX;
  26.   (* Returns the complex exponential of z *)
  27.  
  28. PROCEDURE ln (z: LONGCOMPLEX): LONGCOMPLEX;
  29.   (* Returns the principal value of the natural logarithm of z *)
  30.  
  31. PROCEDURE sin (z: LONGCOMPLEX): LONGCOMPLEX;
  32.   (* Returns the sine of z *)
  33.  
  34. PROCEDURE cos (z: LONGCOMPLEX): LONGCOMPLEX;
  35.   (* Returns the cosine of z *)
  36.  
  37. PROCEDURE tan (z: LONGCOMPLEX): LONGCOMPLEX;
  38.   (* Returns the tangent of z *)
  39.  
  40. PROCEDURE arcsin (z: LONGCOMPLEX): LONGCOMPLEX;
  41.   (* Returns the arcsine of z *)
  42.  
  43. PROCEDURE arccos (z: LONGCOMPLEX): LONGCOMPLEX;
  44.   (* Returns the arccosine of z *)
  45.  
  46. PROCEDURE arctan (z: LONGCOMPLEX): LONGCOMPLEX;
  47.   (* Returns the arctangent of z *)
  48.  
  49. PROCEDURE polarToComplex (abs, arg: LONGREAL): LONGCOMPLEX;
  50.   (* Returns the complex number with the specified polar coordinates *)
  51.  
  52. PROCEDURE scalarMult (scalar: LONGREAL; z: LONGCOMPLEX): LONGCOMPLEX;
  53.   (* Returns the scalar product of scalar with z *)
  54.  
  55. PROCEDURE IsCMathException (): BOOLEAN;
  56.   (* Returns TRUE if the current coroutine is in the exceptional execution state
  57.      because of the raising of an exception in a routine from this module; otherwise
  58.      returns FALSE.
  59.   *)
  60.  
  61. END LongComplexMath.
  62.  
  63.