# Mathematical routine

The DataOperation routine contains functions which perform mathematical operations.

You can access these functions by double-clicking the Mathematical node under the system routines folder in the Repository tree view.

Functions of the DataOperation routineFunctions of the DataOperationDataOperation routine

| Function | Description | Syntax |
| --- | --- | --- |
| ABS | Returns the absolute (positive) numeric value of an expression that is of<br>the double type. This function returns a value of the<br>double type.<br><br>Example:<br><br><ul><li><span>Mathematical.ABS(-3.14)</span></li> <li>Output: <span>3.14</span></li></ul> | Mathematical.ABS(double a) |
| ACOS | Calculates the trigonometric arc-cosine of an expression that is of the<br>double type. This function returns a value of the<br>double type.<br><br>Example:<br><br><ul><li><span>Mathematical.ACOS(0.5)</span></li> <li>Output: <span>1.0471975511965979</span></li></ul> | Mathematical.ACOS(double a) |
| ASIN | Calculates the trigonometric arc-sine of an expression that is of the<br>double type. This function returns a value of the<br>double type.<br><br>Example:<br><br><ul><li><span>Mathematical.ASIN(0.5)</span></li> <li>Output: <span>0.5235987755982989</span></li></ul> | Mathematical.ASIN(double a) |
| ATAN | Calculates the trigonometric arctangent of an expression that is of the<br>double type. This function returns a value of the<br>double type.<br><br>Example:<br><br><ul><li><span>Mathematical.ATAN(0.5)</span></li> <li>Output: <span>0.4636476090008061</span></li></ul> | Mathematical.ATAN(double a) |
| BITAND | Performs a bitwise AND operation to two expressions that are of the<br>int type. This function returns a value of the<br>int type.<br><br>Example:<br><br><ul><li><span>Mathematical.BITAND(3,6)</span></li> <li>Output: <span>2</span></li></ul> | Mathematical.BITAND(int a, int b) |
| BITNOT | Performs a bitwise NOT operation to an expression that is of the<br>int type. This function returns a value of the<br>int type.<br><br>Example:<br><br><ul><li><span>Mathematical.BITNOT(3)</span></li> <li>Output: <span>-4</span></li></ul> | Mathematical.BITNOT(int a) |
| BITOR | Performs a bitwise OR operation to two expressions that are of the<br>int type. This function returns a value of the<br>int type.<br><br>Example:<br><br><ul><li><span>Mathematical.BITOR(3,6)</span></li> <li>Output: <span>7</span></li></ul> | Mathematical.BITOR(int a, int b) |
| BITXOR | Performs a bitwise XOR operation to two expressions that are of the<br>int type. This function returns a value of the<br>int type.<br><br>Example:<br><br><ul><li><span>Mathematical.BITXOR(3,6)</span></li> <li>Output: <span>5</span></li></ul> | Mathematical.BITXOR(int a, int b) |
| COS | Calculates the trigonometric cosine of an expression that is of the<br>double type. This function returns a value of the<br>double type.<br><br>Example:<br><br><ul><li><span>Mathematical.COS(3.14)</span></li> <li>Output: <span>-0.9999987317275395</span></li></ul> | Mathematical.COS(double a) |
| COSH | Calculates the hyperbolic cosine of an expression that is of the<br>double type. This function returns a value of the<br>double type.<br><br>Example:<br><br><ul><li><span>Mathematical.COSH(3.14)</span></li> <li>Output: <span>11.573574828312076</span></li></ul> | Mathematical.COSH(double a) |
| DIV | Calculates the whole part of the real division that are of two expressions<br>that are of the double type. This function returns a<br>value of the int type.<br><br>Example:<br><br><ul><li><span>Mathematical.DIV(9.6,6.4)</span></li> <li>Output: <span>1</span></li></ul> | Mathematical.DIV(double a, double b) |
| EXP | Calculates the result of base e raised to the power<br>designated by an expression that is of the double type.<br>This function returns a value of the double type.<br><br>Example:<br><br><ul><li><span>Mathematical.EXP(2.5)</span></li> <li>Output: <span>12.182493960703473</span></li></ul> | Mathematical.EXP(double a) |
| INT | Calculates the integer numeric value of an expression that is of the<br>string type. This function returns a value of the<br>int type.<br><br>Example:<br><br><ul><li><span>Mathematical.INT("100")</span></li> <li>Output: <span>100</span></li></ul> | Mathematical.INT(string a) |
| FFIX | Rounds the value of an expression that is of the double<br>type to a string with a fixed precision. FFIX is provided for compatibility<br>with existing software. This function returns a value of the<br>string type.<br><br>Example:<br><br><ul><li><span>Mathematical.FFIX(3.1415926.2)</span></li> <li>Output: <span>3.14</span></li></ul> | Mathematical.FFIX(double a, int precision) |
| FFLT | Rounds the value of an expression that is of the double<br>type to a string with a precision of 14. This function returns a value of<br>the string type.<br><br>Example:<br><br><ul><li><span>Mathematical.FFLT(3.1415926535897932)</span></li> <li>Output: <span>3.14159265358979</span></li></ul> | Mathematical.FFLT(double a) |
| LN | Calculates the natural logarithm of an expression that is of the<br>double type. This function returns a value of the<br>double type.<br><br>Example:<br><br><ul><li><span>Mathematical.LN(2.71828)</span></li> <li>Output: <span>0.999999327347282</span></li></ul> | Mathematical.LN(double a) |
| MOD | Calculates the modulo (the remainder) of two expressions that is of the<br>double type. This function returns a value of the<br>String type.<br><br>Example:<br><br><ul><li><span>Mathematical.MOD(7,3)</span></li> <li>Output: <span>1.0</span></li></ul> | Mathematical.MOD(double a, double b) |
| NEG | Returns the arithmetic additive inverse of the value of an expression that<br>is of the double type. This function returns a value of<br>the double type.<br><br>Example:<br><br><ul><li><span>Mathematical.NEG(3.14)</span></li> <li>Output: <span>-3.14</span></li></ul> | Mathematical.NEG(double a) |
| NUM | Returns true (1) if the value of an expression is a numeric data type;<br>otherwise, returns false (0).<br><br>Example:<br><br><ul><li><span>Mathematical.NUM("3")</span></li> <li>Output: <span>1</span></li></ul> | Mathematical.NUM(double a) |
| REAL | Converts a numeric expression into a real number without loss of accuracy.<br>This function returns a value of the double type.<br><br>Example:<br><br><ul><li><span>Mathematical.REAL("3.14")</span></li> <li>Output: <span>3.14</span></li></ul> | Mathematical.REAL(double a) |
| RND | Generates a random number between zero and the value of an expression that<br>is of the double type. This function returns a value of<br>the double type.<br><br>Example:<br><br><ul><li><span>Mathematical.RND(1.5)</span></li> <li>Output: <span>0.6509250767781953</span></li></ul> | Mathematical.SADD(double a) |
| SADD | Adds two string numbers and returns the result as a string number.<br><br>Example:<br><br><ul><li><span>Mathematical.SADD("3","7")</span></li> <li>Output: <span>10.0</span></li></ul> | Mathematical.SADD(String a,String b) |
| SCMP | Compares two string numbers and returns:<br><br><ul> <li><span>1</span> if <span>a</span> is larger than                              <span>b</span>;</li> <li><span>0</span> if <span>a</span> is equal to <span>b</span>;</li> <li><span>-1</span> if <span>a</span> is less than <span>b</span>.</li> </ul><br><br>Example:<br><br><ul><li><span>Mathematical.SCMP("3","7")</span></li> <li>Output: <span>-1</span></li></ul> | Mathematical.SCMP(String a,String b) |
| SDIV | Returns the quotient of the whole division of two integers. This function<br>returns a value of the int type.<br><br>Example:<br><br><ul><li><span>Mathematical.SDIV(7,3)</span></li> <li>Output: <span>2</span></li></ul> | Mathematical.SDIV(int a, int b) |
| SIN | Returns the trigonometric sine of an expression. This function returns a<br>value of the double type.<br><br>Example:<br><br><ul><li><span>Mathematical.SIN(3.14/4)</span></li> <li>Output: <span>0.706825181105366</span></li></ul> | Mathematical.SIN(double a) |
| SINH | Returns the hyperbolic sine of an expression. This function returns a value<br>of the double type.<br><br>Example:<br><br><ul><li><span>Mathematical.SIN(3.14/4)</span></li> <li>Output: <span>0.8681436194737884</span></li></ul> | Mathematical.SINH(double a) |
| SMUL | Multiplies two string numbers. This function returns a value of the<br>double type.<br><br>Example:<br><br><ul><li><span>Mathematical.SMUL("4","5")</span></li> <li>Output: <span>20.0</span></li></ul> | Mathematical.SMUL(String a,String b) |
| SQRT | Calculates the square root of a number. This function returns a value of the<br>double type.<br><br>Example:<br><br><ul><li><span>Mathematical.SQRT(1.69)</span></li> <li>Output: <span>1.3</span></li></ul> | Mathematical.SQRT(double a) |
| SSUB | Subtracts one string number from another and returns the result as a string<br>number.<br><br>Example:<br><br><ul><li><span>Mathematical.SSUB("5","3")</span></li> <li>Output: <span>2.0</span></li></ul> | Mathematical.SSUB(String a,String b) |
| TAN | Returns the trigonometric tangent of an expression. This function returns a<br>value of the double type.<br><br>Example:<br><br><ul><li><span>Mathematical.TAN(3.14/4)</span></li> <li>Output: <span>0.9992039901050427</span></li></ul> | Mathematical.TAN(double a) |
| TANH | Returns the hyperbolic tangent of an expression. This function returns a<br>value of the double type.<br><br>Example:<br><br><ul><li><span>Mathematical.TANH(3.14/4)</span></li> <li>Output: <span>0.6555672165322445</span></li></ul> | Mathematical.TANH(double a) |