====== Extended Math Functions ====== Extended Math Functions in OpenInsight 9.3 and above _addx (add) _subx (subtract) _mulx (multiply) _divx (divide) _eqx (equal, to full precision) _nex (not equal, to full precision) _ltx (less than, to full precision) _gtx (greater than, to full precision) _lex (less than or equal, to full precision) _gex (greater than or equal, to full precision) _cmpx (compare, to full precision) These functions allow you to perform math operations using full precision or a specified precision. For _addx, _subx, and _mulx, the calculations are performed at full precision, and the returned result is rounded or padded as needed if a specific precision is provided. For _divx, the calculation is limited to the number of decimal places specified, or 128 places if none is specified, and then the return result is rounded or padded to the specific precision if any is provided. **NOTE:** In OpenInsight 10.x, extended precision operations can be enabled for regular math operations. For details, please see [[third_party_content:revdevx:18797.6599305556|this article]]. ==== _ADDX ==== The _addx function adds two numbers. The required precision (number of decimal places) is an optional parameter. The syntax is as follows: ans = _addx( num1, num2 [, decimalPlaces] ) For example: a = "10.3456" b = "4.567" decimalPlaces = 2 x1 = _addx( a, b, decimalPlaces ) x2 = _addx( a, b ); * // For full precision. // x1 will return 14.91 // x2 will return 14.9126 ==== _SUBX ==== The _subx function subtracts two numbers. The required precision (number of decimal places) is an optional parameter. The syntax is as follows: ans = _subx( num1, num2 [, decimalPlaces] ) For example: a = "10.3456" b = "4.567" decimalPlaces = 2 x1 = _subx( a, b, decimalPlaces ) x2 = _subx( a, b ); * // For full precision. // x1 will return 5.78 // x2 will return 5.7786 ==== _MULX ==== The _mulx function multiplies two numbers. The required precision (number of decimal places) is an optional parameter. The syntax is as follows: ans = _mulx( num1, num2 [, decimalPlaces] ) For example: a = "10.3456" b = "4.567" decimalPlaces = 2 x1 = _mulx( a, b, decimalPlaces ) x2 = _mulx( a, b ); * // For full precision. // x1 will return 47.25 // x2 will return 47.2483552 ==== _DIVX ==== The _divx function divides two numbers. The required precision (number of decimal places) is an optional parameter. The syntax is as follows: ans = _divx( num1, num2 [, decimalPlaces] ) For example: a = "10.3456" b = "4" decimalPlaces = 4 x1 = _divx( a, b, decimalPlaces ) x2 = _divx( a, b ); * // For full precision. // x1 will return 2.6140 // x2 will return 2.6140000000000 ... ==== _EQX function ==== Equal, to full precision For example: a = "10.3456" b = "10.34567" If a _eqx b Then … ==== _NEX function ==== Not equal, to full precision For example: a = "10.3456" b = "10.34567" If a _nex b Then … ==== _LTX function ==== Less than, to full precision For example: a = "10.3456" b = "10.34567" If a _ltx b Then … ==== _GTX function ==== Greater than, to full precision For example: a = "10.3456" b = "10.34567" If a _gtx b Then … ==== _LEX function ==== Less than or equal, to full precision For example: a = "10.3456" b = "10.34567" If a _lex b Then … ==== _GEX function ==== Greater than or equal, to full precision For example: a = "10.3456" b = "10.34567" If a _gex b Then … ==== _CMPX function ==== Compare two numbers, to full precision. Returns 1 if first number is greater than the 2nd, 0 if the first number is equal to the 2nd, and -1 if the first number is less than the 2nd For example: a = "10.3456" b = "10.34567" rslt = _cmpx(a,b) If rslt == 1 Then …