Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Strange behavior with double variables
#7
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.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)