You are using all int values in your arithmetic operation so final result will always be int and when you put it into a double then it becomes 66.0. But since original result is int, so you loose precision.
You can use double d = (2.0*100.0)/3.0;
or have at least one value with decimal point, so that you can get expected decimal points.
Number after decimal point is commonly known as precision. So, the issue which you talked about is commonly known as floating-point imprecision, and in your case you can call it as double-point imprecision.
Rule of thumb:
- If either is of type double, the other is converted to double for arithmetic operation and final result will be a double.
- Otherwise, if either is a float, the other is converted to float for arithmetic operation and final result will be a float.
- Otherwise, if either is of type long, the other is converted to long for arithmetic operation and final result will be a long.
- Otherwise, both operands are converted to int for arithmetic operation and final result will be a int.