I'm doing multiplication and division of float
s and int
s and I forget the implicit conversion rules (and the words in the question seem too vague to google more quickly than asking here).
If I have two int
s, but I want to do floating-point division, do I need only to cast one or both of the operands? How about for multiplication — if I multiply a float
and an int
, is the answer a float
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…