The following mathematical functions are available in the RPG xTools.
Include member: MBR(MATH) in srcfile(QCPYSRC)
| Function | Returns |
| r = acos( X ) | arc cosine of X |
| r = asin( X ) | arcsine of X |
| r = atan( X ) | arctangent of X |
| r = atan2( X : Y ) | arctangent of X / Y |
| r = atanh( X ) | arctangent Hyperbolic of X |
| r = cos( X ) | cosine of X |
| r = cosh( X ) | cosine hyperbolic of X |
| r = exp( X ) | e raised to the power of X |
| r = fact( X! ) | factorial of X. X! = 2*3*4*5...(X-1)*X (1 to 20) |
| r = gamma( X ) | gamma of X |
| r = gammaln( X ) | gamma log of X |
| r = LN ( X ) | natural log (base e) of X |
| r = log10( X ) | Log base 10 of X |
| r = log2( X ) | Log base 2 of X |
| r = Mod( X : Y ) | remainder of X / Y using integer division |
| r = Pwr( X : Y ) | exponentiation of X raised to the power of Y |
| r = root( X : Y ) | root Y of X |
| r = sin( X ) | sine of X |
| r = sinh( X ) | hyperbolic sine of X |
| r = tan( X ) | tangent of X |
| r = tanh( X ) | tangent Hyperbolic of X |
See the prototypes for specific data type requirements. All math procedures pass by value so numeric data of any type, including expressions may be specified.
/INCLUDE QCPYSRC,MATH
.....DName+++++++++++EUDSFrom+++To+++++TDc.Functions+++++++++
D Factorial S 11P 0
C Eval Factorial = Fact(16)