Division of Integers
Division of integers is not closed. Apart from division by zero being undefined, the quotient is not an integer unless the dividend is an integer multiple of the divisor. For example 26 cannot be divided by 11 to give an integer. Such a case uses one of five approaches:
- Say that 26 cannot be divided by 11; division becomes a partial function.
- Give an approximate answer as a decimal fraction or a mixed number, so or This is the approach usually taken in numerical computation.
- Give the answer as a fraction representing a rational number, so the result of the division of 26 by 11 is But, usually, the resulting fraction should be simplified: the result of the division of 52 by 22 is also This simplification may be done by factoring out the greatest common divisor computed by mean of Euclidean algorithm.
- Give the answer as an integer quotient and a remainder, so To make the distinction with the previous case, this division, with two integers as result, is sometimes called Euclidean division, because it is the basis of Euclidean algorithm.
- Give the integer quotient as the answer, so This is sometimes called integer division.
Dividing integers in a computer program requires special care. Some programming languages, such as C, treat integer division as in case 5 above, so the answer is an integer. Other languages, such as MATLAB and every computer algebra system return a rational number as the answer, as in case 3 above. These languages provide also functions to get the results of the other cases, either directly of from the result of case 3.
Names and symbols used for integer division include div, /, \, and %. Definitions vary regarding integer division when the dividend or the divisor is negative: rounding may be toward zero (so called T-division) or toward −∞ (F-division); rarer styles can occur – see Modulo operation for the details.
Divisibility rules can sometimes be used to quickly determine whether one integer divides exactly into another.
Read more about this topic: Division (mathematics)
Famous quotes containing the words division of and/or division:
“Between married persons, the cement of friendship is by the laws supposed so strong as to abolish all division of possessions: and has often, in reality, the force ascribed to it.
”
—David Hume (17111776)
“Dont order any black things. Rejoice in his memory; and be radiant: leave grief to the children. Wear violet and purple.... Be patient with the poor people who will snivel: they dont know; and they think they will live for ever, which makes death a division instead of a bond.”
—George Bernard Shaw (18561950)