rxmath.cpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.ibm.com/developerworks/oss/CPLv1.0.htm */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* REXX mathematical function support rxmath.c */
40 /* */
41 /* AIX mathematical utility function package */
42 /* */
43 /******************************************************************************/
44 
45 /**********************************************************************
46 * RXMATH.C *
47 * *
48 * This program extends the REXX language by providing many *
49 * external mathematical functions *
50 * These functions are: *
51 * RxCalcPi -- Return Pi to given precision *
52 * RxCalcSqrt -- Calculate a square root *
53 * RxCalcExp -- Calculate an exponent *
54 * RxCalcLog -- Return natural log of a number *
55 * RxCalcLog10 -- Return log base 10 of a number *
56 * RxCalcSinh -- Hyperbolic sine function *
57 * RxCalcCosh -- Hyperbolic cosine function *
58 * RxCalcTanh -- Hyperbolic tangent function *
59 * RxCalcPower -- raise number to non-integer power *
60 * RxCalcSin -- Sine function *
61 * RxCalcCos -- Cosine function *
62 * RxCalcTan -- Tangent function *
63 * RxCalcCotan -- Cotangent function *
64 * RxCalcArcSin -- ArcSine function *
65 * RxCalcArcCos -- ArcCosine function *
66 * RxCalcArcTan -- ArcTangent function *
67 * *
68 **********************************************************************/
69 
70 #include <errno.h>
71 
72 /*------------------------------------------------------------------
73  * program defines
74  *------------------------------------------------------------------*/
75 
76 
77 #define PROG_DESC "REXX mathematical function package"
78 #define PROG_VERS "1.1"
79 #define PROG_SECU " "
80 #define PROG_COPY "(c) Copyright RexxLanguage Association 2005."
81 #define PROG_ALRR "All Rights Reserved."
82 
83 /*------------------------------------------------------------------
84  * standard includes
85  *------------------------------------------------------------------*/
86 #include <stdio.h>
87 #include <stdlib.h>
88 #include <string.h>
89 
90 #include <ctype.h>
91 
92 #include <math.h>
93 #include <fcntl.h>
94 
95 /*------------------------------------------------------------------
96  * rexx includes
97  *------------------------------------------------------------------*/
98 #include "oorexxapi.h"
99 #include <sys/types.h>
100 
101 #define MAX_DIGITS 9
102 
103 /*********************************************************************/
104 /* Various definitions used by the math functions */
105 /*********************************************************************/
106 #define SINE 0 /* trig function defines... */
107 #define COSINE 3 /* the ordering is important, */
108 #define TANGENT 1 /* as these get transformed */
109 #define COTANGENT 2 /* depending on the angle */
110 #define MAXTRIG 3 /* value */
111 #define ARCSINE 0 /* defines for arc trig */
112 #define ARCCOSINE 1 /* functions. Ordering is */
113 #define ARCTANGENT 2 /* not as important here */
114 
115 #define pi 3.14159265358979323846l /* pi value */
116 
117 #define MAX_PRECISION 16 /* maximum available precision*/
118 #define MIN_PRECISION 1 /* minimum available precision*/
119 
120 /* Turn off optimization under Windows. If this is compiler under */
121 /* Windows with the MS Visual C++ copiler and optimization is on */
122 /* then the function _matherr is not called */
123 #ifdef WIN32
124 #pragma optimize( "", off )
125 #endif
126 
127 
128 
129 
130 // simple class for handling numeric values
132 {
133 public:
134  NumericFormatter(RexxCallContext *c, bool explicitPrecision, uint32_t p)
135  {
136  optionError = false;
137  precision = p;
138  context = c;
139  if (explicitPrecision)
140  {
141  if (p == 0)
142  {
143  // raise an error on return
144  context->InvalidRoutine();
145  // remember we rejected this
146  optionError = true;
147  }
148  }
149  else
150  {
151  precision = (int)context->GetContextDigits();
152  }
153  // cap this value
154  if (precision > MAX_PRECISION)
155  {
157  }
158  }
159 
161  {
162  // we've already raised an error here, so don't bother formatting a value
163  if (optionError)
164  {
165  return NULLOBJECT;
166  }
167 
168  return context->DoubleToObjectWithPrecision(x, precision);
169  }
170 
171 protected:
174 
175  bool optionError; // had invalid options and we're going to raise an error
176 };
177 
179 {
180 public:
181 
182  TrigFormatter(RexxCallContext *c, bool explicitPrecision, uint32_t p, const char *u) : NumericFormatter(c, explicitPrecision, p)
183  {
184  units = DEGREES;
185  // process any units option
186  if (u != NULL)
187  {
188  switch (*u)
189  {
190  case 'D':
191  case 'd':
192  units = DEGREES;
193  break;
194 
195  case 'R':
196  case 'r':
197  units = RADIANS;
198  break;
199 
200  case 'G':
201  case 'g':
202  units = GRADES;
203  break;
204 
205  default:
206  context->InvalidRoutine();
207  optionError = true;
208  }
209  }
210  }
211 
212  RexxObjectPtr evaluate(double angle, int function)
213  {
214  // if we've had an option error, we can't contine
215  if (optionError)
216  {
217  return NULLOBJECT;
218  }
219 
220  double nsi; /* convertion factor */
221  double nco; /* convertion factor */
222  double result; /* result */
223 
224  nsi = 1.; /* set default conversion */
225  nco = 1.; /* set default conversion */
226 
227  switch (units)
228  {
229  case DEGREES: { /* need to convert degrees */
230  nsi = (angle < 0.) ? -1. : 1.; /* get the direction */
231  angle = fmod(fabs(angle), 360.); /* make modulo 360 */
232  if (angle <= 45.) /* less than 45? */
233  {
234  angle = angle * pi / 180.;
235  }
236  else if (angle < 135.)
237  { /* over on the other side? */
238  angle = (90. - angle) * pi / 180.;
239  function = MAXTRIG - function; /* change the function */
240  nco = nsi; /* swap around the conversions*/
241  nsi = 1.;
242  }
243  else if (angle <= 225.)
244  { /* around the other way? */
245  angle = (180. - angle) * pi / 180.;
246  nco = -1.;
247  }
248  else if (angle < 315.)
249  { /* close to the origin? */
250  angle = (angle - 270.) * pi / 180.;
251  function = MAXTRIG - function; /* change the function */
252  nco = -nsi;
253  nsi = 1.;
254  }
255  else
256  {
257  angle = (angle - 360.) * pi / 180.;
258  }
259  break;
260  }
261 
262  case GRADES: { /* need to convert degrees */
263  nsi = (angle < 0.) ? -1. : 1.; /* get the direction */
264  angle = fmod(fabs(angle), 400.); /* make modulo 400 */
265  if (angle <= 50.)
266  {
267  angle = angle * pi / 200.;
268  }
269  else if (angle < 150.)
270  {
271  angle = (100. - angle) * pi / 200.;
272  function = MAXTRIG - function; /* change the function */
273  nco = nsi; /* swap the conversions */
274  nsi = 1.;
275  }
276  else if (angle <= 250.)
277  {
278  angle = (200. - angle) * pi / 200.;
279  nco = -1.;
280  }
281  else if (angle < 350.)
282  {
283  angle = (angle - 300.) * pi / 200.;
284  function = MAXTRIG - function; /* change the function */
285  nco = -nsi;
286  nsi = 1.;
287  }
288  else
289  {
290  angle = (angle - 400.) * pi / 200.;
291  }
292  break;
293  }
294 
295  // radians are already ok
296  case RADIANS:
297  break;
298  }
299  switch (function) /* process the function */
300  {
301  case SINE: /* Sine function */
302  result = nsi * sin(angle);
303  break;
304  case COSINE: /* Cosine function */
305  result = nco * cos(angle);
306  break;
307  case TANGENT: /* Tangent function */
308  result = nsi * nco * tan(angle);
309  break;
310  case COTANGENT: /* cotangent function */
311  // this could produce a divide by zero, which gives a real result
312  // with floating point values (+infinity or -infinity)
313  result = nsi * nco / tan(result); /* real result */
314  break;
315  }
316 
317  // now format based on precision setting
318  return format(result);
319  }
320 
321  RexxObjectPtr evaluateArc(double x, int function)
322  {
323  // if we've had an option error, we can't contine
324  if (optionError)
325  {
326  return NULLOBJECT;
327  }
328 
329  double angle; /* working angle */
330  double nsi; /* convertion factor */
331  double nco; /* convertion factor */
332 
333  nsi = 1.; /* set default conversion */
334  nco = 1.; /* set default conversion */
335 
336  switch (function) /* process the function */
337  {
338  case ARCSINE: /* ArcSine function */
339  angle = asin(x);
340  break;
341  case ARCCOSINE: /* ArcCosine function */
342  angle = acos(x);
343  break;
344  case ARCTANGENT: /* ArcTangent function */
345  angle = atan(x);
346  break;
347  }
348  if (units == DEGREES) /* have to convert the result?*/
349  {
350  angle = angle * 180. / pi; /* make into degrees */
351  }
352  else if (units == GRADES) /* need it in grades? */
353  {
354  angle = angle * 200. / pi; /* convert to base 400 */
355  }
356  // now format based on precision setting
357  return format(angle);
358  }
359 
360 protected:
361  typedef enum
362  {
365  GRADES
366  } Units;
367 
368  Units units; // the type of units to process
369 };
370 
371 
372 /* Helper functions **************************************************/
373 
374 /*************************************************************************
375 * Function: matherr *
376 * *
377 * Syntax: matherr is called by the system if exist whenever a mathe *
378 * matical function fails. *
379 * *
380 * Return: NO_UTIL_ERROR - Successful. *
381 *************************************************************************/
382 #ifdef WIN32
383 int _cdecl _matherr(struct _exception *x )
384 #elif OPSYS_SUN
385 int matherr(struct __math_exception *x) /* return string */
386 #elif OPSYS_AIX
387 int matherr(struct __exception *x) /* return string */
388 #endif
389 #if defined(WIN32) || defined(OPSYS_SUN) || defined(OPSYS_AIX)
390 {
391  // we'll just swallow this and allow nans to be generated
392  return(1);
393 }
394 #endif
395 
396 /*************************************************************************
397 * Function: MathLoadFuncs *
398 * *
399 * Syntax: call MathLoadFuncs *
400 * *
401 * Purpose: load the function package *
402 * *
403 * Params: none *
404 * *
405 * Return: null string *
406 *************************************************************************/
407 RexxRoutine1(CSTRING, MathLoadFuncs, OPTIONAL_CSTRING, version)
408 {
409  if (version != NULL)
410  {
411  fprintf(stdout, "%s %s - %s\n","rxmath",PROG_VERS,PROG_DESC);
412  fprintf(stdout, "%s\n",PROG_COPY);
413  fprintf(stdout, "%s\n",PROG_ALRR);
414  fprintf(stdout, "\n");
415  }
416 
417  // the rest is a nop now that this uses automatic loading.
418  return "";
419 }
420 
421 /*************************************************************************
422 * Function: MathDropFuncs *
423 * *
424 * Syntax: call MathDropFuncs *
425 * *
426 * Return: NO_UTIL_ERROR - Successful. *
427 *************************************************************************/
428 
429 RexxRoutine0(CSTRING, MathDropFuncs)
430 {
431  // this is a nop now.
432  return "";
433 }
434 
435 /* Mathematical function package *************************************/
436 
437 /********************************************************************/
438 /* Functions: RxCalcSqrt(), RxCalcExp(), RxCalcLog(), RxCalcLog10, */
439 /* Functions: RxCalcSinH(), RxCalcCosH(), RxCalcTanH() */
440 /* Description: Returns function value of argument. */
441 /* Input: One number. */
442 /* Output: Value of the function requested for arg. */
443 /* Returns 0 if the function executed OK, */
444 /* 40 otherwise. The interpreter will fail */
445 /* if the function returns a negative result. */
446 /* Notes: */
447 /* These routines take one to two parameters. */
448 /* The form of the call is: */
449 /* result = func_name(x <, prec>) */
450 /* */
451 /********************************************************************/
452 RexxRoutine2(RexxObjectPtr, RxCalcSqrt, double, x, OPTIONAL_uint32_t, precision)
453 {
454  NumericFormatter formatter(context, argumentExists(2), precision);
455 
456  // calculate and return
457  return formatter.format(sqrt(x));
458 }
459 
460 /*==================================================================*/
461 RexxRoutine2(RexxObjectPtr, RxCalcExp, double, x, OPTIONAL_uint32_t, precision)
462 {
463  NumericFormatter formatter(context, argumentExists(2), precision);
464 
465  // calculate and return
466  return formatter.format(exp(x));
467 }
468 
469 /*==================================================================*/
470 RexxRoutine2(RexxObjectPtr, RxCalcLog, double, x, OPTIONAL_uint32_t, precision)
471 {
472  NumericFormatter formatter(context, argumentExists(2), precision);
473 
474  // calculate and return
475  return formatter.format(log(x));
476 }
477 
478 RexxRoutine2(RexxObjectPtr, RxCalcLog10, double, x, OPTIONAL_uint32_t, precision)
479 {
480  NumericFormatter formatter(context, argumentExists(2), precision);
481 
482  // calculate and return
483  return formatter.format(log10(x));
484 }
485 
486 
487 /*==================================================================*/
488 RexxRoutine2(RexxObjectPtr, RxCalcSinH, double, x, OPTIONAL_uint32_t, precision)
489 {
490  NumericFormatter formatter(context, argumentExists(2), precision);
491 
492  // calculate and return
493  return formatter.format(sinh(x));
494 }
495 
496 /*==================================================================*/
497 RexxRoutine2(RexxObjectPtr, RxCalcCosH, double, x, OPTIONAL_uint32_t, precision)
498 {
499  NumericFormatter formatter(context, argumentExists(2), precision);
500 
501  // calculate and return
502  return formatter.format(cosh(x));
503 }
504 
505 /*==================================================================*/
506 RexxRoutine2(RexxObjectPtr, RxCalcTanH, double, x, OPTIONAL_uint32_t, precision)
507 {
508  NumericFormatter formatter(context, argumentExists(2), precision);
509 
510  // calculate and return
511  return formatter.format(tanh(x));
512 }
513 
514 /********************************************************************/
515 /* Functions: RxCalcPower() */
516 /* Description: Returns function value of arguments. */
517 /* Input: Two numbers. */
518 /* Output: Value of the x to the power y. */
519 /* Returns 0 if the function executed OK, */
520 /* -1 otherwise. The interpreter will fail */
521 /* if the function returns a negative result. */
522 /* Notes: */
523 /* This routine takes two to three parameters. */
524 /* The form of the call is: */
525 /* result = func_name(x, y <, prec>) */
526 /* */
527 /********************************************************************/
528 RexxRoutine3(RexxObjectPtr, RxCalcPower, double, x, double, y, OPTIONAL_uint32_t, precision)
529 {
530  NumericFormatter formatter(context, argumentExists(3), precision);
531 
532  // calculate and return
533  return formatter.format(pow(x, y));
534 }
535 
536 /********************************************************************/
537 /* Functions: RxCalcSin(), RxCalcCos(), RxCalcTan(), RxCalcCotan() */
538 /* Description: Returns trigonometric angle value. */
539 /* Input: Angle in radian or degree or grade */
540 /* Output: Trigonometric function value for Angle. */
541 /* Returns 0 if the function executed OK, */
542 /* -1 otherwise. The interpreter will fail */
543 /* if the function returns a negative result. */
544 /* Notes: */
545 /* These routines take one to three parameters. */
546 /* The form of the call is: */
547 /* x = func_name(angle <, prec> <, [R | D | G]>) */
548 /* */
549 /********************************************************************/
550 RexxRoutine3(RexxObjectPtr, RxCalcSin, double, angle, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
551 {
552  TrigFormatter formatter(context, argumentExists(2), precision, units);
553  // calculate and return
554  return formatter.evaluate(angle, SINE);
555 }
556 
557 /*==================================================================*/
558 RexxRoutine3(RexxObjectPtr, RxCalcCos, double, angle, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
559 {
560  TrigFormatter formatter(context, argumentExists(2), precision, units);
561  // calculate and return
562  return formatter.evaluate(angle, COSINE);
563 }
564 
565 /*==================================================================*/
566 RexxRoutine3(RexxObjectPtr, RxCalcTan, double, angle, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
567 {
568  TrigFormatter formatter(context, argumentExists(2), precision, units);
569  // calculate and return
570  return formatter.evaluate(angle, TANGENT);
571 }
572 
573 /*==================================================================*/
574 RexxRoutine3(RexxObjectPtr, RxCalcCotan, double, angle, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
575 {
576  TrigFormatter formatter(context, argumentExists(2), precision, units);
577  // calculate and return
578  return formatter.evaluate(angle, COTANGENT);
579 }
580 
581 /********************************************************************/
582 /* Functions: RxCalcPi() */
583 /* Description: Returns value of pi for given precision */
584 /* Input: Precision. Default is 9 */
585 /* Output: Value of the pi to given precision */
586 /* Notes: */
587 /* This routine takes one parameters. */
588 /* The form of the call is: */
589 /* result = RxCalcpi(<precision>) */
590 /* */
591 /********************************************************************/
592 RexxRoutine1(RexxObjectPtr, RxCalcPi, OPTIONAL_uint32_t, precision)
593 {
594  NumericFormatter formatter(context, argumentExists(1), precision);
595  return formatter.format(pi);
596 }
597 
598 /********************************************************************/
599 /* Functions: RxCalcArcSin(), RxCalcArcCos(), RxCalcArcTan()*/
600 /* Description: Returns angle from trigonometric value. */
601 /* Input: a number */
602 /* Output: Angle for matching trigonometric value. */
603 /* Returns nan if the first argument is out */
604 /* of range, e.g., RxCalcSin(1.1) -> nan */
605 /* Notes: */
606 /* These routines take one to three parameters. */
607 /* The form of the call is: */
608 /* a = func_name(arg <, prec> <, [R | D | G]>) */
609 /* */
610 /********************************************************************/
611 RexxRoutine3(RexxObjectPtr, RxCalcArcSin, double, x, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
612 {
613  TrigFormatter formatter(context, argumentExists(2), precision, units);
614  // calculate and return
615  return formatter.evaluateArc(x, ARCSINE);
616 }
617 
618 /*==================================================================*/
619 RexxRoutine3(RexxObjectPtr, RxCalcArcCos, double, x, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
620 {
621  TrigFormatter formatter(context, argumentExists(2), precision, units);
622  // calculate and return
623  return formatter.evaluateArc(x, ARCCOSINE);
624 }
625 
626 /*==================================================================*/
627 RexxRoutine3(RexxObjectPtr, RxCalcArcTan, double, x, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
628 {
629  TrigFormatter formatter(context, argumentExists(2), precision, units);
630  // calculate and return
631  return formatter.evaluateArc(x, ARCTANGENT);
632 }
633 
634 // now build the actual entry list
636 {
637  REXX_TYPED_ROUTINE(MathLoadFuncs, MathLoadFuncs),
638  REXX_TYPED_ROUTINE(MathDropFuncs, MathDropFuncs),
639  REXX_TYPED_ROUTINE(RxCalcPi, RxCalcPi),
640  REXX_TYPED_ROUTINE(RxCalcSqrt, RxCalcSqrt),
641  REXX_TYPED_ROUTINE(RxCalcExp, RxCalcExp),
642  REXX_TYPED_ROUTINE(RxCalcLog, RxCalcLog),
643  REXX_TYPED_ROUTINE(RxCalcLog10, RxCalcLog10),
644  REXX_TYPED_ROUTINE(RxCalcSinH, RxCalcSinH),
645  REXX_TYPED_ROUTINE(RxCalcCosH, RxCalcCosH),
646  REXX_TYPED_ROUTINE(RxCalcTanH, RxCalcTanH),
647  REXX_TYPED_ROUTINE(RxCalcPower, RxCalcPower),
648  REXX_TYPED_ROUTINE(RxCalcSin, RxCalcSin),
649  REXX_TYPED_ROUTINE(RxCalcCos, RxCalcCos),
650  REXX_TYPED_ROUTINE(RxCalcTan, RxCalcTan),
651  REXX_TYPED_ROUTINE(RxCalcCotan, RxCalcCotan),
652  REXX_TYPED_ROUTINE(RxCalcArcSin, RxCalcArcSin),
653  REXX_TYPED_ROUTINE(RxCalcArcCos, RxCalcArcCos),
654  REXX_TYPED_ROUTINE(RxCalcArcTan, RxCalcArcTan),
656 };
657 
659 {
661  REXX_INTERPRETER_4_0_0, // anything after 4.0.0 will work
662  "RXMATH", // name of the package
663  "4.0", // package information
664  NULL, // no load/unload functions
665  NULL,
666  rxmath_functions, // the exported functions
667  NULL // no methods in rxmath.
668 };
669 
670 // package loading stub.
672 
673 #ifdef WIN32
674 #pragma optimize( "", on )
675 #endif
RexxObjectPtr format(double x)
Definition: rxmath.cpp:160
RexxCallContext * context
Definition: rxmath.cpp:173
NumericFormatter(RexxCallContext *c, bool explicitPrecision, uint32_t p)
Definition: rxmath.cpp:134
uint32_t precision
Definition: rxmath.cpp:172
TrigFormatter(RexxCallContext *c, bool explicitPrecision, uint32_t p, const char *u)
Definition: rxmath.cpp:182
Units units
Definition: rxmath.cpp:368
RexxObjectPtr evaluateArc(double x, int function)
Definition: rxmath.cpp:321
RexxObjectPtr evaluate(double angle, int function)
Definition: rxmath.cpp:212
#define argumentExists(i)
Definition: oorexxapi.h:3777
#define REXX_INTERPRETER_4_0_0
Definition: oorexxapi.h:216
#define REXX_LAST_ROUTINE()
Definition: oorexxapi.h:193
#define REXX_TYPED_ROUTINE(n, e)
Definition: oorexxapi.h:191
#define STANDARD_PACKAGE_HEADER
Definition: oorexxapi.h:230
const char * CSTRING
Definition: rexx.h:78
struct _RexxObjectPtr * RexxObjectPtr
Definition: rexx.h:127
#define NULLOBJECT
Definition: rexx.h:147
#define PROG_ALRR
Definition: rxmath.cpp:81
#define COTANGENT
Definition: rxmath.cpp:109
#define pi
Definition: rxmath.cpp:115
#define ARCCOSINE
Definition: rxmath.cpp:112
#define ARCTANGENT
Definition: rxmath.cpp:113
#define PROG_VERS
Definition: rxmath.cpp:78
#define PROG_COPY
Definition: rxmath.cpp:80
#define SINE
Definition: rxmath.cpp:106
RexxRoutine2(RexxObjectPtr, RxCalcSqrt, double, x, OPTIONAL_uint32_t, precision)
Definition: rxmath.cpp:452
#define MAX_PRECISION
Definition: rxmath.cpp:117
RexxRoutine1(CSTRING, MathLoadFuncs, OPTIONAL_CSTRING, version)
Definition: rxmath.cpp:407
RexxPackageEntry rxmath_package_entry
Definition: rxmath.cpp:658
#define MAXTRIG
Definition: rxmath.cpp:110
#define ARCSINE
Definition: rxmath.cpp:111
#define TANGENT
Definition: rxmath.cpp:108
RexxRoutineEntry rxmath_functions[]
Definition: rxmath.cpp:635
#define PROG_DESC
Definition: rxmath.cpp:77
RexxRoutine0(CSTRING, MathDropFuncs)
Definition: rxmath.cpp:429
#define COSINE
Definition: rxmath.cpp:107
RexxRoutine3(RexxObjectPtr, RxCalcPower, double, x, double, y, OPTIONAL_uint32_t, precision)
Definition: rxmath.cpp:528
OOREXX_GET_PACKAGE(rxmath)
Definition: oorexxapi.h:242
Definition: oorexxapi.h:177
unsigned int uint32_t