12-13-2012, 05:16 AM
In expression 3/2, types of both operands are int, therefore calculates the expression with int precision.
In expression 3.0/2, type of one of operands is double, therefore calculates the expression with double precision, because it is higher than int.
The rules are like in C++ language.
In expression 3.0/2, type of one of operands is double, therefore calculates the expression with double precision, because it is higher than int.
The rules are like in C++ language.
