Division operation is giving me the wrong result
问题 I'm trying to divide one number by another in Processing, and I keep getting the wrong answer. float a; a = 3/2; println(a); gives me 1.0 when then answer should be 1.5. Trying a different number, float a; a = 2/3; println(a); gives me 0.0 when the answer should be 0.666666.... Is there something I'm missing? I looked over the Processing documentation for division and it seems like I'm using the right syntax. 回答1: Like others have said, you're using integer division. Remember that int values