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."
90 #include <sys/types.h>
104 #define pi 3.14159265358979323846l
106 #define MAX_PRECISION 16
107 #define MIN_PRECISION 1
120 if (explicitPrecision)
211 nsi = (angle < 0.) ? -1. : 1.;
212 angle = fmod(fabs(angle), 360.);
215 angle = angle *
pi / 180.;
217 else if (angle < 135.)
219 angle = (90. - angle) *
pi / 180.;
224 else if (angle <= 225.)
226 angle = (180. - angle) *
pi / 180.;
229 else if (angle < 315.)
231 angle = (angle - 270.) *
pi / 180.;
238 angle = (angle - 360.) *
pi / 180.;
244 nsi = (angle < 0.) ? -1. : 1.;
245 angle = fmod(fabs(angle), 400.);
248 angle = angle *
pi / 200.;
250 else if (angle < 150.)
252 angle = (100. - angle) *
pi / 200.;
257 else if (angle <= 250.)
259 angle = (200. - angle) *
pi / 200.;
262 else if (angle < 350.)
264 angle = (angle - 300.) *
pi / 200.;
271 angle = (angle - 400.) *
pi / 200.;
283 result = nsi * sin(angle);
286 result = nco * cos(angle);
289 result = nsi * nco * tan(angle);
294 result = nsi * nco / tan(angle);
331 angle = angle * 180. /
pi;
335 angle = angle * 200. /
pi;
380 fprintf(stdout,
"\n");
423 return formatter.
format(sqrt(x));
432 return formatter.
format(exp(x));
444 return formatter.
format(nan(
""));
447 return formatter.
format(log(x));
458 return formatter.
format(nan(
""));
461 return formatter.
format(log10(x));
471 return formatter.
format(sinh(x));
480 return formatter.
format(cosh(x));
489 return formatter.
format(tanh(x));
511 return formatter.
format(pow(x, y));
596 if (x < -1.0 || x > 1.0)
598 return formatter.
format(nan(
""));
612 if (x < -1.0 || x > 1.0)
614 return formatter.
format(nan(
""));
#define argumentExists(i)
#define REXX_INTERPRETER_4_0_0
#define REXX_LAST_ROUTINE()
#define REXX_TYPED_ROUTINE(n, e)
#define STANDARD_PACKAGE_HEADER
struct _RexxObjectPtr * RexxObjectPtr
RexxRoutine2(RexxObjectPtr, RxCalcSqrt, double, x, OPTIONAL_uint32_t, precision)
RexxRoutine1(CSTRING, MathLoadFuncs, OPTIONAL_CSTRING, version)
RexxPackageEntry rxmath_package_entry
RexxRoutineEntry rxmath_functions[]
RexxRoutine0(CSTRING, MathDropFuncs)
RexxRoutine3(RexxObjectPtr, RxCalcPower, double, x, double, y, OPTIONAL_uint32_t, precision)
OOREXX_GET_PACKAGE(rxmath)