Division with doubles gives you a decimal answer, e.g. 25.0 / 4.0 = 6.25
Integer division is a little different from
everyday division because of the fact that computers can lose information due to
precision constraints. For example, when you divide 27 by 5, the result is a
real number (a number with a decimal component). Integers don't have a decimal
component (or a fraction component) and so the "remainder" is
discarded.
The division of two integers like 27 divided by 5 will result in
an answer of 5. The ".4" gets discarded. |