home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lisp / interpre / xlispplu / xmath / xmath.doc next >
Text File  |  1988-06-28  |  4KB  |  93 lines

  1.                       XLISP Math Library
  2.                              by
  3.                        George V. Wilson
  4.  
  5.    This library provides some Common LISP math support for XLISP. It was
  6.  written and tested using XLISP ver. 1.6.  To load the library from XLISP,
  7.  type     (load 'math)     .
  8.  
  9.  
  10.  
  11.     Loading the library will have the following effects.
  12.  
  13.        1. pi will be a global variable with value 3.1415926536
  14.  
  15.        2. A number of XLISP math functions work only for floating point
  16.           arguements. The library redefines these to work for with
  17.           integer arguements as well (by floating the arguements).
  18.           The functions redefined for this reason are:
  19.                    NAME               PURPOSE
  20.                    ------------------------------
  21.                    sqrt               square root
  22.                    sin                sine
  23.                    cos                cosine
  24.                    tan                tangent
  25.                    exp                e to the x
  26.                    expt               x to the y
  27.  
  28.        3. A number of Common LISP math functions are missing from XLISP.
  29.           The library adds the following functions:
  30.               NAME           ARGUEMENTS(type)              RETURNS
  31.               -----------------------------------------------------------
  32.               signum          x (number)                  1   if x>0
  33.                                                          -1   if x<0
  34.                                                           0   if x=0
  35.  
  36.               round           x (number)                  x rounded to
  37.                                                           an integer
  38.  
  39.               atan            x (number)                  arctan(x)
  40.  
  41.               asin            x (number)                  arcsin(x)
  42.  
  43.               acos            x (number)                  arccos(x)
  44.  
  45.               log             x (number)
  46.                               y (number)(optional)       if y is supplied
  47.                                                          return is log
  48.                                                          base y of x. If
  49.                                                          y is not supplied,
  50.                                                          return is ln(x)
  51.  
  52.               integerp        x (any object)             returns T if x is
  53.                                                          an integer, NIL
  54.                                                          otherwise.
  55.  
  56.               gcd             any number of              returns the greatest
  57.                               integer arguements         common divisor of
  58.                                                          the arguements.
  59.  
  60.               lcm             any number of              returns the least
  61.                               integer arguements         common multiple
  62.                                                          of the arguements.
  63.  
  64.               incf            x (number)                 returns x+y and has
  65.                               y (number)(optional)       also binds x to x+y
  66.  
  67.  
  68.        4. A non-Common LISP function euclid_gcd is created which was used
  69.           in writing gcd.   This function finds the gcd of two positive
  70.           integers.
  71.  
  72.        5. A global variable named *math_lib_loaded* is created and set to T.
  73.           The math library will load only if this variable is unbound. This
  74.           prevents loading the library twice, which would destroy the
  75.           functions described in  2.  above. If the library could be loaded
  76.           twice, calling these functions would produce infinite loops.
  77.  
  78.  
  79.  
  80.     The new floating point functions should produce full single precision
  81.   accuracy.  The functions have been carefully tested, but oversights are
  82.   always possible.  If you have trouble with one of the functions, please
  83.   give me a full description of the circumstances at:
  84.  
  85.                     George V. Wilson
  86.                     3932 Lincolnshire St.
  87.                     Annandale, VA 22003
  88.  
  89.  
  90.  
  91.  
  92.  
  93.