Typecasting Double question

Hello all I have a question regarding the question below.
int b = 4, p = 5, r = 2, v = 8;
double x = 10.2;

x = 8 - (double) p / r * b; x =

is the whole problem considered data type double? or just the arithmetic on the right of double? do i get a integer value after i get to 8- whatever value i get from the right of double?

so far i have double 5/2 * 4 = 10. When i get to 8-10 is the answer -2.0 or just -2?
When i get to 8-10 is the answer -2.0 or just -2?


The value is the same either way. The type is double.
Topic archived. No new replies allowed.