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-2021 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 /* https://www.oorexx.org/license.html */
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 */
40 /* */
41 /* mathematical utility function package */
42 /* */
43 /******************************************************************************/
44 
45 /**********************************************************************
46 * *
47 * This program extends the REXX language by providing many *
48 * external mathematical functions *
49 * These functions are: *
50 * RxCalcPi -- Return Pi to given precision *
51 * RxCalcSqrt -- Calculate a square root *
52 * RxCalcExp -- Calculate an exponent *
53 * RxCalcLog -- Return natural log of a number *
54 * RxCalcLog10 -- Return log base 10 of a number *
55 * RxCalcSinh -- Hyperbolic sine function *
56 * RxCalcCosh -- Hyperbolic cosine function *
57 * RxCalcTanh -- Hyperbolic tangent function *
58 * RxCalcPower -- raise number to non-integer power *
59 * RxCalcSin -- Sine function *
60 * RxCalcCos -- Cosine function *
61 * RxCalcTan -- Tangent function *
62 * RxCalcCotan -- Cotangent function *
63 * RxCalcArcSin -- ArcSine function *
64 * RxCalcArcCos -- ArcCosine function *
65 * RxCalcArcTan -- ArcTangent function *
66 * *
67 **********************************************************************/
68 
69 /*------------------------------------------------------------------
70  * program defines
71  *------------------------------------------------------------------*/
72 #define PROG_DESC "REXX mathematical function library"
73 #define PROG_VERS "1.2"
74 #define PROG_COPY "Copyright (c) 2005-2021 Rexx Language Association."
75 #define PROG_ALRR "All rights reserved."
76 
77 /*------------------------------------------------------------------
78  * standard includes
79  *------------------------------------------------------------------*/
80 #include <stdio.h>
81 #include <stdlib.h>
82 #include <string.h>
83 #include <ctype.h>
84 #include <math.h>
85 
86 /*------------------------------------------------------------------
87  * rexx includes
88  *------------------------------------------------------------------*/
89 #include "oorexxapi.h"
90 #include <sys/types.h>
91 
92 /*********************************************************************/
93 /* Various definitions used by the math functions */
94 /*********************************************************************/
95 #define SINE 0 /* trig function defines... */
96 #define COSINE 3 /* the ordering is important, */
97 #define TANGENT 1 /* as these get transformed */
98 #define COTANGENT 2 /* depending on the angle */
99 #define MAXTRIG 3 /* value */
100 #define ARCSINE 0 /* defines for arc trig */
101 #define ARCCOSINE 1 /* functions. Ordering is */
102 #define ARCTANGENT 2 /* not as important here */
103 
104 #define pi 3.14159265358979323846l /* pi value */
105 
106 #define MAX_PRECISION 16 /* maximum available precision*/
107 #define MIN_PRECISION 1 /* minimum available precision*/
108 
109 
110 
111 // simple class for handling numeric values
113 {
114 public:
115  NumericFormatter(RexxCallContext *c, bool explicitPrecision, uint32_t p)
116  {
117  optionError = false;
118  precision = p;
119  context = c;
120  if (explicitPrecision)
121  {
122  if (p == 0)
123  {
124  // raise an error on return
125  context->InvalidRoutine();
126  // remember we rejected this
127  optionError = true;
128  }
129  }
130  else
131  {
132  precision = (int)context->GetContextDigits();
133  }
134  // cap this value
135  if (precision > MAX_PRECISION)
136  {
138  }
139  }
140 
142  {
143  // we've already raised an error here, so don't bother formatting a value
144  if (optionError)
145  {
146  return NULLOBJECT;
147  }
148 
149  return context->DoubleToObjectWithPrecision(x, precision);
150  }
151 
152 protected:
155 
156  bool optionError; // had invalid options and we're going to raise an error
157 };
158 
160 {
161 public:
162 
163  TrigFormatter(RexxCallContext *c, bool explicitPrecision, uint32_t p, const char *u) : NumericFormatter(c, explicitPrecision, p)
164  {
165  units = DEGREES;
166  // process any units option
167  if (u != NULL)
168  {
169  switch (*u)
170  {
171  case 'D':
172  case 'd':
173  units = DEGREES;
174  break;
175 
176  case 'R':
177  case 'r':
178  units = RADIANS;
179  break;
180 
181  case 'G':
182  case 'g':
183  units = GRADES;
184  break;
185 
186  default:
187  context->InvalidRoutine();
188  optionError = true;
189  }
190  }
191  }
192 
193  RexxObjectPtr evaluate(double angle, int function)
194  {
195  // if we've had an option error, we can't contine
196  if (optionError)
197  {
198  return NULLOBJECT;
199  }
200 
201  double nsi; /* convertion factor */
202  double nco; /* convertion factor */
203  double result; /* result */
204 
205  nsi = 1.; /* set default conversion */
206  nco = 1.; /* set default conversion */
207 
208  switch (units)
209  {
210  case DEGREES: { /* need to convert degrees */
211  nsi = (angle < 0.) ? -1. : 1.; /* get the direction */
212  angle = fmod(fabs(angle), 360.); /* make modulo 360 */
213  if (angle <= 45.) /* less than 45? */
214  {
215  angle = angle * pi / 180.;
216  }
217  else if (angle < 135.)
218  { /* over on the other side? */
219  angle = (90. - angle) * pi / 180.;
220  function = MAXTRIG - function; /* change the function */
221  nco = nsi; /* swap around the conversions*/
222  nsi = 1.;
223  }
224  else if (angle <= 225.)
225  { /* around the other way? */
226  angle = (180. - angle) * pi / 180.;
227  nco = -1.;
228  }
229  else if (angle < 315.)
230  { /* close to the origin? */
231  angle = (angle - 270.) * pi / 180.;
232  function = MAXTRIG - function; /* change the function */
233  nco = -nsi;
234  nsi = 1.;
235  }
236  else
237  {
238  angle = (angle - 360.) * pi / 180.;
239  }
240  break;
241  }
242 
243  case GRADES: { /* need to convert degrees */
244  nsi = (angle < 0.) ? -1. : 1.; /* get the direction */
245  angle = fmod(fabs(angle), 400.); /* make modulo 400 */
246  if (angle <= 50.)
247  {
248  angle = angle * pi / 200.;
249  }
250  else if (angle < 150.)
251  {
252  angle = (100. - angle) * pi / 200.;
253  function = MAXTRIG - function; /* change the function */
254  nco = nsi; /* swap the conversions */
255  nsi = 1.;
256  }
257  else if (angle <= 250.)
258  {
259  angle = (200. - angle) * pi / 200.;
260  nco = -1.;
261  }
262  else if (angle < 350.)
263  {
264  angle = (angle - 300.) * pi / 200.;
265  function = MAXTRIG - function; /* change the function */
266  nco = -nsi;
267  nsi = 1.;
268  }
269  else
270  {
271  angle = (angle - 400.) * pi / 200.;
272  }
273  break;
274  }
275 
276  // radians are already ok
277  case RADIANS:
278  break;
279  }
280  switch (function) /* process the function */
281  {
282  case SINE: /* Sine function */
283  result = nsi * sin(angle);
284  break;
285  case COSINE: /* Cosine function */
286  result = nco * cos(angle);
287  break;
288  case TANGENT: /* Tangent function */
289  result = nsi * nco * tan(angle);
290  break;
291  case COTANGENT: /* cotangent function */
292  // this could produce a divide by zero, which gives a real result
293  // with floating point values (+infinity or -infinity)
294  result = nsi * nco / tan(angle); /* real result */
295  break;
296  }
297 
298  // now format based on precision setting
299  return format(result);
300  }
301 
302  RexxObjectPtr evaluateArc(double x, int function)
303  {
304  // if we've had an option error, we can't contine
305  if (optionError)
306  {
307  return NULLOBJECT;
308  }
309 
310  double angle; /* working angle */
311  double nsi; /* convertion factor */
312  double nco; /* convertion factor */
313 
314  nsi = 1.; /* set default conversion */
315  nco = 1.; /* set default conversion */
316 
317  switch (function) /* process the function */
318  {
319  case ARCSINE: /* ArcSine function */
320  angle = asin(x);
321  break;
322  case ARCCOSINE: /* ArcCosine function */
323  angle = acos(x);
324  break;
325  case ARCTANGENT: /* ArcTangent function */
326  angle = atan(x);
327  break;
328  }
329  if (units == DEGREES) /* have to convert the result?*/
330  {
331  angle = angle * 180. / pi; /* make into degrees */
332  }
333  else if (units == GRADES) /* need it in grades? */
334  {
335  angle = angle * 200. / pi; /* convert to base 400 */
336  }
337  // now format based on precision setting
338  return format(angle);
339  }
340 
341 protected:
342  typedef enum
343  {
346  GRADES
347  } Units;
348 
349  Units units; // the type of units to process
350 };
351 
352 
353 /*
354 We no longer use matherr()
355 We can't on Windows (https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/matherr)
356 "you cannot replace the default _matherr routine in a DLL client of the CRT DLL"
357 
358 On Linux matherr() is "marked as obsolete. Since glibc 2.27, the mechanism has
359 been removed altogether"
360 */
361 
362 /*************************************************************************
363 * Function: MathLoadFuncs *
364 * *
365 * Syntax: call MathLoadFuncs *
366 * *
367 * Purpose: load the function package *
368 * *
369 * Params: none *
370 * *
371 * Return: null string *
372 *************************************************************************/
373 RexxRoutine1(CSTRING, MathLoadFuncs, OPTIONAL_CSTRING, version)
374 {
375  if (version != NULL)
376  {
377  fprintf(stdout, "%s %s - %s\n","rxmath",PROG_VERS,PROG_DESC);
378  fprintf(stdout, "%s\n",PROG_COPY);
379  fprintf(stdout, "%s\n",PROG_ALRR);
380  fprintf(stdout, "\n");
381  }
382 
383  // the rest is a nop now that this uses automatic loading.
384  return "";
385 }
386 
387 /*************************************************************************
388 * Function: MathDropFuncs *
389 * *
390 * Syntax: call MathDropFuncs *
391 * *
392 * Return: NO_UTIL_ERROR - Successful. *
393 *************************************************************************/
394 
395 RexxRoutine0(CSTRING, MathDropFuncs)
396 {
397  // this is a nop now.
398  return "";
399 }
400 
401 /* Mathematical function package *************************************/
402 
403 /********************************************************************/
404 /* Functions: RxCalcSqrt(), RxCalcExp(), RxCalcLog(), RxCalcLog10, */
405 /* Functions: RxCalcSinH(), RxCalcCosH(), RxCalcTanH() */
406 /* Description: Returns function value of argument. */
407 /* Input: One number. */
408 /* Output: Value of the function requested for arg. */
409 /* Returns 0 if the function executed OK, */
410 /* 40 otherwise. The interpreter will fail */
411 /* if the function returns a negative result. */
412 /* Notes: */
413 /* These routines take one to two parameters. */
414 /* The form of the call is: */
415 /* result = func_name(x <, prec>) */
416 /* */
417 /********************************************************************/
418 RexxRoutine2(RexxObjectPtr, RxCalcSqrt, double, x, OPTIONAL_uint32_t, precision)
419 {
420  NumericFormatter formatter(context, argumentExists(2), precision);
421 
422  // calculate and return
423  return formatter.format(sqrt(x));
424 }
425 
426 /*==================================================================*/
427 RexxRoutine2(RexxObjectPtr, RxCalcExp, double, x, OPTIONAL_uint32_t, precision)
428 {
429  NumericFormatter formatter(context, argumentExists(2), precision);
430 
431  // calculate and return
432  return formatter.format(exp(x));
433 }
434 
435 /*==================================================================*/
436 RexxRoutine2(RexxObjectPtr, RxCalcLog, double, x, OPTIONAL_uint32_t, precision)
437 {
438  NumericFormatter formatter(context, argumentExists(2), precision);
439 
440  // on SunOS/Solaris/OpenIndiana log(-1) returns -infinity, not nan
441  // we manually check here for a valid domain
442  if (x < 0.0)
443  {
444  return formatter.format(nan(""));
445  }
446  // calculate and return
447  return formatter.format(log(x));
448 }
449 
450 RexxRoutine2(RexxObjectPtr, RxCalcLog10, double, x, OPTIONAL_uint32_t, precision)
451 {
452  NumericFormatter formatter(context, argumentExists(2), precision);
453 
454  // on SunOS/Solaris/OpenIndiana log10(-1) returns -infinity, not nan
455  // we manually check here for a valid domain
456  if (x < 0.0)
457  {
458  return formatter.format(nan(""));
459  }
460  // calculate and return
461  return formatter.format(log10(x));
462 }
463 
464 
465 /*==================================================================*/
466 RexxRoutine2(RexxObjectPtr, RxCalcSinH, double, x, OPTIONAL_uint32_t, precision)
467 {
468  NumericFormatter formatter(context, argumentExists(2), precision);
469 
470  // calculate and return
471  return formatter.format(sinh(x));
472 }
473 
474 /*==================================================================*/
475 RexxRoutine2(RexxObjectPtr, RxCalcCosH, double, x, OPTIONAL_uint32_t, precision)
476 {
477  NumericFormatter formatter(context, argumentExists(2), precision);
478 
479  // calculate and return
480  return formatter.format(cosh(x));
481 }
482 
483 /*==================================================================*/
484 RexxRoutine2(RexxObjectPtr, RxCalcTanH, double, x, OPTIONAL_uint32_t, precision)
485 {
486  NumericFormatter formatter(context, argumentExists(2), precision);
487 
488  // calculate and return
489  return formatter.format(tanh(x));
490 }
491 
492 /********************************************************************/
493 /* Functions: RxCalcPower() */
494 /* Description: Returns function value of arguments. */
495 /* Input: Two numbers. */
496 /* Output: Value of the x to the power y. */
497 /* Returns 0 if the function executed OK, */
498 /* -1 otherwise. The interpreter will fail */
499 /* if the function returns a negative result. */
500 /* Notes: */
501 /* This routine takes two to three parameters. */
502 /* The form of the call is: */
503 /* result = func_name(x, y <, prec>) */
504 /* */
505 /********************************************************************/
506 RexxRoutine3(RexxObjectPtr, RxCalcPower, double, x, double, y, OPTIONAL_uint32_t, precision)
507 {
508  NumericFormatter formatter(context, argumentExists(3), precision);
509 
510  // calculate and return
511  return formatter.format(pow(x, y));
512 }
513 
514 /********************************************************************/
515 /* Functions: RxCalcSin(), RxCalcCos(), RxCalcTan(), RxCalcCotan() */
516 /* Description: Returns trigonometric angle value. */
517 /* Input: Angle in radian or degree or grade */
518 /* Output: Trigonometric function value for Angle. */
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 /* These routines take one to three parameters. */
524 /* The form of the call is: */
525 /* x = func_name(angle <, prec> <, [R | D | G]>) */
526 /* */
527 /********************************************************************/
528 RexxRoutine3(RexxObjectPtr, RxCalcSin, double, angle, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
529 {
530  TrigFormatter formatter(context, argumentExists(2), precision, units);
531  // calculate and return
532  return formatter.evaluate(angle, SINE);
533 }
534 
535 /*==================================================================*/
536 RexxRoutine3(RexxObjectPtr, RxCalcCos, double, angle, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
537 {
538  TrigFormatter formatter(context, argumentExists(2), precision, units);
539  // calculate and return
540  return formatter.evaluate(angle, COSINE);
541 }
542 
543 /*==================================================================*/
544 RexxRoutine3(RexxObjectPtr, RxCalcTan, double, angle, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
545 {
546  TrigFormatter formatter(context, argumentExists(2), precision, units);
547  // calculate and return
548  return formatter.evaluate(angle, TANGENT);
549 }
550 
551 /*==================================================================*/
552 RexxRoutine3(RexxObjectPtr, RxCalcCotan, double, angle, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
553 {
554  TrigFormatter formatter(context, argumentExists(2), precision, units);
555  // calculate and return
556  return formatter.evaluate(angle, COTANGENT);
557 }
558 
559 /********************************************************************/
560 /* Functions: RxCalcPi() */
561 /* Description: Returns value of pi for given precision */
562 /* Input: Precision. Default is 9 */
563 /* Output: Value of the pi to given precision */
564 /* Notes: */
565 /* This routine takes one parameters. */
566 /* The form of the call is: */
567 /* result = RxCalcpi(<precision>) */
568 /* */
569 /********************************************************************/
570 RexxRoutine1(RexxObjectPtr, RxCalcPi, OPTIONAL_uint32_t, precision)
571 {
572  NumericFormatter formatter(context, argumentExists(1), precision);
573  return formatter.format(pi);
574 }
575 
576 /********************************************************************/
577 /* Functions: RxCalcArcSin(), RxCalcArcCos(), RxCalcArcTan()*/
578 /* Description: Returns angle from trigonometric value. */
579 /* Input: a number */
580 /* Output: Angle for matching trigonometric value. */
581 /* Returns nan if the first argument is out */
582 /* of range, e.g., RxCalcSin(1.1) -> nan */
583 /* Notes: */
584 /* These routines take one to three parameters. */
585 /* The form of the call is: */
586 /* a = func_name(arg <, prec> <, [R | D | G]>) */
587 /* */
588 /********************************************************************/
589 RexxRoutine3(RexxObjectPtr, RxCalcArcSin, double, x, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
590 {
591  TrigFormatter formatter(context, argumentExists(2), precision, units);
592 
593  // on SunOS/Solaris/OpenIndiana asin(2) returns 0, not nan
594  // https://docs.oracle.com/cd/E36784_01/html/E36877/matherr-3m.html
595  // we manually check here for a valid domain
596  if (x < -1.0 || x > 1.0)
597  {
598  return formatter.format(nan(""));
599  }
600  // calculate and return
601  return formatter.evaluateArc(x, ARCSINE);
602 }
603 
604 /*==================================================================*/
605 RexxRoutine3(RexxObjectPtr, RxCalcArcCos, double, x, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
606 {
607  TrigFormatter formatter(context, argumentExists(2), precision, units);
608 
609  // on SunOS/Solaris/OpenIndiana acos(2) returns 0, not nan
610  // https://docs.oracle.com/cd/E36784_01/html/E36877/matherr-3m.html
611  // we manually check here for a valid domain
612  if (x < -1.0 || x > 1.0)
613  {
614  return formatter.format(nan(""));
615  }
616  // calculate and return
617  return formatter.evaluateArc(x, ARCCOSINE);
618 }
619 
620 /*==================================================================*/
621 RexxRoutine3(RexxObjectPtr, RxCalcArcTan, double, x, OPTIONAL_uint32_t, precision, OPTIONAL_CSTRING, units)
622 {
623  TrigFormatter formatter(context, argumentExists(2), precision, units);
624  // calculate and return
625  return formatter.evaluateArc(x, ARCTANGENT);
626 }
627 
628 // now build the actual entry list
630 {
631  REXX_TYPED_ROUTINE(MathLoadFuncs, MathLoadFuncs),
632  REXX_TYPED_ROUTINE(MathDropFuncs, MathDropFuncs),
633  REXX_TYPED_ROUTINE(RxCalcPi, RxCalcPi),
634  REXX_TYPED_ROUTINE(RxCalcSqrt, RxCalcSqrt),
635  REXX_TYPED_ROUTINE(RxCalcExp, RxCalcExp),
636  REXX_TYPED_ROUTINE(RxCalcLog, RxCalcLog),
637  REXX_TYPED_ROUTINE(RxCalcLog10, RxCalcLog10),
638  REXX_TYPED_ROUTINE(RxCalcSinH, RxCalcSinH),
639  REXX_TYPED_ROUTINE(RxCalcCosH, RxCalcCosH),
640  REXX_TYPED_ROUTINE(RxCalcTanH, RxCalcTanH),
641  REXX_TYPED_ROUTINE(RxCalcPower, RxCalcPower),
642  REXX_TYPED_ROUTINE(RxCalcSin, RxCalcSin),
643  REXX_TYPED_ROUTINE(RxCalcCos, RxCalcCos),
644  REXX_TYPED_ROUTINE(RxCalcTan, RxCalcTan),
645  REXX_TYPED_ROUTINE(RxCalcCotan, RxCalcCotan),
646  REXX_TYPED_ROUTINE(RxCalcArcSin, RxCalcArcSin),
647  REXX_TYPED_ROUTINE(RxCalcArcCos, RxCalcArcCos),
648  REXX_TYPED_ROUTINE(RxCalcArcTan, RxCalcArcTan),
650 };
651 
653 {
655  REXX_INTERPRETER_4_0_0, // anything after 4.0.0 will work
656  "rxmath", // name of the package
657  "4.0", // package information
658  NULL, // no load/unload functions
659  NULL,
660  rxmath_functions, // the exported functions
661  NULL // no methods in rxmath.
662 };
663 
664 // package loading stub.
666 
RexxObjectPtr format(double x)
Definition: rxmath.cpp:141
RexxCallContext * context
Definition: rxmath.cpp:154
NumericFormatter(RexxCallContext *c, bool explicitPrecision, uint32_t p)
Definition: rxmath.cpp:115
uint32_t precision
Definition: rxmath.cpp:153
TrigFormatter(RexxCallContext *c, bool explicitPrecision, uint32_t p, const char *u)
Definition: rxmath.cpp:163
Units units
Definition: rxmath.cpp:349
RexxObjectPtr evaluateArc(double x, int function)
Definition: rxmath.cpp:302
RexxObjectPtr evaluate(double angle, int function)
Definition: rxmath.cpp:193
#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:75
#define COTANGENT
Definition: rxmath.cpp:98
#define pi
Definition: rxmath.cpp:104
#define ARCCOSINE
Definition: rxmath.cpp:101
#define ARCTANGENT
Definition: rxmath.cpp:102
#define PROG_VERS
Definition: rxmath.cpp:73
#define PROG_COPY
Definition: rxmath.cpp:74
#define SINE
Definition: rxmath.cpp:95
RexxRoutine2(RexxObjectPtr, RxCalcSqrt, double, x, OPTIONAL_uint32_t, precision)
Definition: rxmath.cpp:418
#define MAX_PRECISION
Definition: rxmath.cpp:106
RexxRoutine1(CSTRING, MathLoadFuncs, OPTIONAL_CSTRING, version)
Definition: rxmath.cpp:373
RexxPackageEntry rxmath_package_entry
Definition: rxmath.cpp:652
#define MAXTRIG
Definition: rxmath.cpp:99
#define ARCSINE
Definition: rxmath.cpp:100
#define TANGENT
Definition: rxmath.cpp:97
RexxRoutineEntry rxmath_functions[]
Definition: rxmath.cpp:629
#define PROG_DESC
Definition: rxmath.cpp:72
RexxRoutine0(CSTRING, MathDropFuncs)
Definition: rxmath.cpp:395
#define COSINE
Definition: rxmath.cpp:96
RexxRoutine3(RexxObjectPtr, RxCalcPower, double, x, double, y, OPTIONAL_uint32_t, precision)
Definition: rxmath.cpp:506
OOREXX_GET_PACKAGE(rxmath)
Definition: oorexxapi.h:242
Definition: oorexxapi.h:177
unsigned int uint32_t