|
My guess is landSum, landed, takeSum, tookOff are of an integral type. In this case, you need to convert at least one of the operands to a float.
E.g.: avgLand = (float)landSum/landed;
On the other hand, double type is a performance killer on 32 bit platforms, so you'd be better off with float. Or if that is not a concern, just use
if(Math.random()<whatever){
}
I hope that solves your problem. If not get back to me.
|