home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d3xx / d386 / xlispstat.lha / XLispStat / src2.lzh / XLisp-Stat / math.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-10-05  |  4.4 KB  |  77 lines

  1. /* math - Elementwise arithmetic functions                             */
  2. /* XLISP-STAT 2.1 Copyright (c) 1990, by Luke Tierney                  */
  3. /* Additions to Xlisp 2.1, Copyright (c) 1989 by David Michael Betz    */
  4. /* You may give out copies of this software; for conditions see the    */
  5. /* file COPYING included with this distribution.                       */
  6.  
  7. #include "xlisp.h"
  8. #include "osdef.h"
  9. #ifdef ANSI
  10. #include "xlproto.h"
  11. #include "xlsproto.h"
  12. #else
  13. #include "xlfun.h"
  14. #include "xlsfun.h"
  15. #endif ANSI
  16.  
  17. /*************************************************************************/
  18. /*************************************************************************/
  19. /**                                                                     **/
  20. /**                 Recursive Vectorized Math Functions                 **/
  21. /**                                                                     **/
  22. /*************************************************************************/
  23. /*************************************************************************/
  24.  
  25. /* The basic math functions have been modified to operate element-wise   */
  26. /* on compound data. The operation is recursive: if compound data items  */
  27. /* contain compound data items the mapping proceeds down to the next     */
  28. /* level.                                                                */
  29.  
  30. LVAL xsradd()   { return (recursive_subr_map_elements(xadd, xsradd)); }
  31. LVAL xsrsub()   { return (recursive_subr_map_elements(xsub, xsrsub)); }
  32. LVAL xsrmul()   { return (recursive_subr_map_elements(xmul, xsrmul)); }
  33. LVAL xsrdiv()   { return (recursive_subr_map_elements(xdiv, xsrdiv)); }
  34. LVAL xsrrem()   { return (recursive_subr_map_elements(xrem, xsrrem)); }
  35. LVAL xsrmin()   { return (recursive_subr_map_elements(xmin, xsrmin)); }
  36. LVAL xsrmax()   { return (recursive_subr_map_elements(xmax, xsrmax)); }
  37. LVAL xsrexpt()  { return (recursive_subr_map_elements(xexpt, xsrexpt));}
  38. LVAL xsrlog()   { return (recursive_subr_map_elements(xlog, xsrlog)); }
  39.  
  40. LVAL xsrlogand()   { return (recursive_subr_map_elements(xlogand, xsrlogand)); }
  41. LVAL xsrlogior()   { return (recursive_subr_map_elements(xlogior, xsrlogior)); }
  42. LVAL xsrlogxor()   { return (recursive_subr_map_elements(xlogxor, xsrlogxor)); }
  43. LVAL xsrlognot()   { return (recursive_subr_map_elements(xlognot, xsrlognot)); }
  44.  
  45. LVAL xsrabs()   { return (recursive_subr_map_elements(xabs, xsrabs)); }
  46. LVAL xsradd1()  { return (recursive_subr_map_elements(xadd1, xsradd1)); }
  47. LVAL xsrsub1()  { return (recursive_subr_map_elements(xsub1, xsrsub1)); }
  48. LVAL xsrsin()   { return (recursive_subr_map_elements(xsin, xsrsin)); }
  49. LVAL xsrcos()   { return (recursive_subr_map_elements(xcos, xsrcos)); }
  50. LVAL xsrtan()   { return (recursive_subr_map_elements(xtan, xsrtan)); }
  51. LVAL xsrexp()   { return (recursive_subr_map_elements(xexp, xsrexp)); }
  52. LVAL xsrsqrt()  { return (recursive_subr_map_elements(xsqrt, xsrsqrt)); }
  53. LVAL xsrfix()   { return (recursive_subr_map_elements(xfix, xsrfix)); }
  54. LVAL xsrfloat() { return (recursive_subr_map_elements(xfloat, xsrfloat)); }
  55. LVAL xsrrand()  { return (recursive_subr_map_elements(xrand, xsrrand)); }
  56. LVAL xsrfloor() { return (recursive_subr_map_elements(xfloor, xsrfloor)); }
  57. LVAL xsrceil()  { return (recursive_subr_map_elements(xceil, xsrceil)); }
  58. LVAL xsrround() { return (recursive_subr_map_elements(xround, xsrround)); }
  59. LVAL xsrasin()  { return (recursive_subr_map_elements(xasin, xsrasin)); }
  60. LVAL xsracos()  { return (recursive_subr_map_elements(xacos, xsracos)); }
  61. LVAL xsratan()  { return (recursive_subr_map_elements(xatan, xsratan)); }
  62. LVAL xsrphase()  { return (recursive_subr_map_elements(xphase, xsrphase)); }
  63.  
  64. LVAL xsrminusp(){ return (recursive_subr_map_elements(xminusp, xsrminusp)); }
  65. LVAL xsrzerop() { return (recursive_subr_map_elements(xzerop, xsrzerop)); }
  66. LVAL xsrplusp() { return (recursive_subr_map_elements(xplusp, xsrplusp)); }
  67. LVAL xsrevenp() { return (recursive_subr_map_elements(xevenp, xsrevenp)); }
  68. LVAL xsroddp()  { return (recursive_subr_map_elements(xoddp, xsroddp)); }
  69.  
  70. LVAL xsrlss(){ return (recursive_subr_map_elements(xlss, xsrlss)); }
  71. LVAL xsrleq(){ return (recursive_subr_map_elements(xleq, xsrleq)); }
  72. LVAL xsrequ(){ return (recursive_subr_map_elements(xequ, xsrequ)); }
  73. LVAL xsrneq(){ return (recursive_subr_map_elements(xneq, xsrneq)); }
  74. LVAL xsrgeq(){ return (recursive_subr_map_elements(xgeq, xsrgeq)); }
  75. LVAL xsrgtr(){ return (recursive_subr_map_elements(xgtr, xsrgtr)); }
  76.  
  77.