Thread: java question
View Single Post
Old Nov 9, 2004, 06:08 PM   #5 (permalink)
bug77
DriverHeaven Senior Member
 
Join Date: Oct 2003
Location: around
Posts: 792
bug77 is on a distinguished road

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.
bug77 is offline   Reply With Quote