double x = 0;
double P = 0.327; //P is a actually function that return double and change all the time
double w1 = 1/4; //prints 0 (w1 and w2 are same as P)
double w2= 10/4; //prints 2
x=x+P*w1+(1-P)*w2;
System.out.println(x); // prints 1.346 and the real result is 1.76425
i dont know how to overcome the problem of double that is rounding down, i tried the BigDecimal, maybe i just dont do it right..
i dont need very precise result but i do need the result 1.764. Thanks in advance.