Doing (double) 3/2 will not return the correct result, because Java will calculate the result as an integer division and round down to 1, then cast to a double giving 1.0.

Either specify one of two/three as a double or do the following:

result = 1.5 + (((double) three) / two)

Casting has low precedence in relation to arithmetic operations so it will cast the result if you don't use brackets rather than casting the number.