int x = 1; int y = 9; System.out.println( Math.sqrt( (double)x/y ) );
Yes.
In the above, the integer in x
is
converted to double before the division is done.
Now y
must also be converted to double and
double precision floating point division is performed.
Next the result (0.111111111) is sent to sqrt()
as an argument.
The expected result (0.33333333) is returned.