In mathematics, division (÷) is an arithmetic elementary operation.
In mathematics, especially in elementary arithmetic, division (÷) is an arithmetic operation. Specifically, if b times c equals a (b × c = a
) where b is not zero, then a divided by b equals c (a ÷ b = c
).
In the expression a ÷ b = c
, a is called the dividend, b the divisor and c the quotient.
In programming, division is usually represented by the /
symbol. There are two import forms of division in most programming languages:
In floating point division which operates on floating point or other rational numeric datatypes, the fractional part of the result is included (to the accuracy provided by the datatype):
float a = 5.0; float b = 2.0; float c = a / b; // c = 2.5
In integer division which operates on integral numeric datatypes, the fractional part of the result is discarded, as in following example:
int a = 5; int b = 2; int c = a / b; // c = 2