AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | PTX | SUN | Win NT |
X | X | X | X | X | X | X | X | X |
Purpose
Divides one number by the other.
Format
@DTW_DIVIDE(number1, number2, precision, result)
@DTW_DIVIDE(number1, number2, result)
@DTW_rDIVIDE(number1, number2, precision)
@DTW_rDIVIDE(number1, number2)
Parameters
Table 60. DTW_DIVIDE Parameters
Data Type | Parameter | Use | Description |
---|---|---|---|
float | number1 | IN | A variable or literal string representing a number that is to be divided. |
float | number2 | IN | A variable or literal string representing a number. |
integer | precision | IN | A variable or literal string representing a positive whole number that specifies the precision of the result. The default is 9. |
float | result | OUT | A variable that contains the result of number1 divided by number2. |
Return Codes
Table 61. DTW_DIVIDE Return Codes
Return Code | Explanation |
---|---|
-1001 | The server could not process a Net.Data request to allocate memory. |
1001 | An input parameter contained a NULL value. |
1002 | An input parameter contained a string value which consisted of the null-terminating character. |
1003 | An incorrect number of parameters were passed on a function call. |
1005 | A parameter passed on a function call, required to be a string variable, was of a different variable type. |
1006 | A literal string was passed on a function call for a parameter which was required to be an output parameter. |
4000 | A parameter contains an invalid whole number value. |
4001 | A parameter contains an invalid number value. |
4002 | The result of an arithmetic operation had an exponent that was outside the supported range of -999,999,999 to +999,999,999. |
Examples
Example 1:
@DTW_DIVIDE("8.0", NUM2, result)
Example 2:
@DTW_rDIVIDE("1", NUM2, "5")
Example 3:
@DTW_rDIVIDE(NUM1, "2", "5")