Current location - Training Enrollment Network - Mathematics courses - Introduction to large number operation
Introduction to large number operation
Large number operation, as its name implies, is a series of operations on a large number of values.

We know that in mathematics, there is no upper limit to the size of a numerical value, but in a computer, the range that a computer can represent is limited due to the limitation of word length. When we compare smaller numbers, such as 1234+5678, such values are not out of the range of the computer, so we can perform operations. However, when we do a lot of data processing in practical applications, we will find that the numbers involved in the operation are often beyond the expression range of computer basic data types. For example, in astronomy, if a planet is 65.438+0 billion light years away from us, then when we reduce it to kilometers or meters, we will find that this is a very large number. So the computer will not be able to calculate directly.

Maybe we think that there are only a few hundred large numbers in practical application. In fact, in some fields, there may even be millions of bits of data for operation, which is unimaginable. If there is no computer, the calculation efficiency can be imagined.

Since it can't be expressed directly in the computer, how to operate large numbers? Anyone who has studied data structure knows linear tables, and it is a good idea to split large numbers and store them in linear tables.

The division of large numbers can be compared to human manual calculation, and the difference obtained by subtracting the intermediate result from the divisor participates in the next round of operation until the end. It should be noted here that when adding bits, the quotient sometimes needs to be filled with zeros, and the division operation needs addition, subtraction, multiplication and comparison operations.