1, similarity: the basic concept, whether fractional division or integer division, involves the concept of division, that is, dividing one number (dividend) by another number (divisor). Division operation, both of which follow the basic division algorithm. The results show that the results of fractional division and integer division can be expressed by a quotient and a remainder.
2. Different operation processes: In fractional division, since the dividend and divisor may be decimals, it is necessary to consider the position of the decimal point and the treatment of the remainder during division. In integer division, because the dividend and divisor are integers, there is no need to consider the decimal point.
3. Different algorithm choices: In computer programming, decimal and integer are usually handled in different ways. Therefore, the algorithm of fractional division and integer division may be different. Because decimals contain more decimal places, fractional division is usually more time-consuming than integer division.
4. The nature of dividend and divisor is different: in fractional division, dividend and divisor may be decimals, while in integer division, dividend and divisor are integers. This means that fractional division can handle a wider range of data types. Because the dividend and divisor of fractional division may be decimal, the result is usually decimal. The result of integer division can only be integer or remainder.
Knowledge of fractional division and integer division
1. Precision problem: There may be precision problems when dividing by decimals. This is because in binary or decimal representation, some decimals cannot be accurately represented. This may lead to rounding errors, especially when performing floating-point operations. In contrast, integer division is not affected by this precision problem.
2. Application scenario: Decimal division is mainly used to calculate practical problems involving decimals, scientific calculation, engineering, economics, commodity prices, scientific experimental data and so on. Integer division is mainly used in scenes that do not require accurate calculation. In the fields of algorithm, data structure, discrete mathematics, etc.
3. Exception handling: When carrying out fractional division, special attention should be paid to division by zero or division by zero, because this will lead to mathematical errors or runtime errors. However, in integer division, this situation usually does not occur, unless it involves a special case in which negative numbers are divided by negative numbers.