06-14-2011 7:14 PM
Now lets assume that we don't have absolute figures but variables,
So
" Assume that all the values are of type XKWERT
A = 1
B = 3
C = 3
So, Z = A / B * C
Z = 1/9 = 0.111111111
How does this happen?
Now as strange behaviour has been noticed, in one of our clients Z = 1 and in other client z = 0.111111111
Please let me know the solution.
In which scenario will this happen??
Regards,
Dantham Conplowedson
06-14-2011 9:48 PM
arith_exp - arithmetic operators
The table shows the possible arithmetic operators arithmetic expressions, their priority, and the order of calculation. Within one set of parentheses (see below), calculations with operators of higher priority are performed before calculations with operators of a lower priority. For consecutive operators with the same priority, the calculation is performed in the order specified in the table. In the third column of the table, 3 indicates the highest priority and 1 the lowest.
Operator Calculation Priority Order
+ Addition of operands 1 from left to right
- Subtraction of the right from the left operand 1 left to right
* Multiplication of operands 2 from left to right
/ Division of the left by the right operand 2 from left to right
DIV Integer portion of the division of the left by the right operand 2 from left to right
MOD Integer remainder of the division of the left by the right operand 2 from left to right
** Exponentiation of the left with the right operand 3 from right to left