Different types of arithmetic systems are discussed in the academic literature. They differ from each other based on what type of number they operate on, what numeral system they use to represent them, and whether they operate on mathematical objects other than numbers.
Integer arithmetic Integer arithmetic is the branch of arithmetic that deals with the manipulation of positive and negative whole numbers. Simple one-digit operations can be performed by following or memorizing a table that presents the results of all possible combinations, like an
addition table or a
multiplication table. Other common methods are verbal
counting and
finger-counting. For operations on numbers with more than one digit, different techniques can be employed to calculate the result by using several one-digit operations in a row. For example, in the method
addition with carries, the two numbers are written one above the other. Starting from the rightmost digit, each pair of digits is added together. The rightmost digit of the sum is written below them. If the sum is a two-digit number then the leftmost digit, called the "carry", is added to the next pair of digits to the left. This process is repeated until all digits have been added. Other methods used for integer additions are the
number line method, the partial sum method, and the compensation method. A similar technique is utilized for subtraction: it also starts with the rightmost digit and uses a "borrow" or a negative carry for the column on the left if the result of the one-digit subtraction is negative. A basic technique of integer multiplication employs repeated addition. For example, the product of 3 \times 4 can be calculated as 3 + 3 + 3 + 3. A common technique for multiplication with larger numbers is called
long multiplication. This method starts by writing the multiplier above the multiplicand. The calculation begins by multiplying the multiplier only with the rightmost digit of the multiplicand and writing the result below, starting in the rightmost column. The same is done for each digit of the multiplicand and the result in each case is shifted one position to the left. As a final step, all the individual products are added to arrive at the total product of the two multi-digit numbers. Other techniques used for multiplication are the
grid method and the
lattice method. Computer science is interested in
multiplication algorithms with a low
computational complexity to be able to efficiently multiply very large integers, such as the
Karatsuba algorithm, the
Schönhage–Strassen algorithm, and the
Toom–Cook algorithm. A common technique used for division is called
long division. Other methods include
short division and
chunking. Integer arithmetic is not closed under division. This means that when dividing one integer by another integer, the result is not always an integer. For instance, 7 divided by 2 is not a whole number but 3.5. One way to ensure that the result is an integer is to
round the result to a whole number. However, this method leads to inaccuracies as the original value is altered. Another method is to perform the division only partially and retain the
remainder. For example, 7 divided by 2 is 3 with a remainder of 1. These difficulties are avoided by rational number arithmetic, which allows for the exact representation of fractions. A simple method to calculate
exponentiation is by repeated multiplication. For instance, the exponentiation of 3^4 can be calculated as 3 \times 3 \times 3 \times 3. A more efficient technique used for large exponents is
exponentiation by squaring. It breaks down the calculation into a number of squaring operations. For example, the exponentiation 3^{65} can be written as (((((3^2)^2)^2)^2)^2)^2 \times 3. By taking advantage of repeated squaring operations, only 7 individual operations are needed rather than the 64 operations required for regular repeated multiplication. Methods to calculate
logarithms include the
Taylor series and
continued fractions. Integer arithmetic is not closed under logarithm and under exponentiation with negative exponents, meaning that the result of these operations is not always an integer.
Number theory Number theory studies the structure and properties of integers as well as the relations and laws between them. Some of the main branches of modern number theory include
elementary number theory,
analytic number theory,
algebraic number theory, and
geometric number theory. Elementary number theory studies aspects of integers that can be investigated using elementary methods. Its topics include
divisibility,
factorization, and
primality. Analytic number theory, by contrast, relies on techniques from analysis and calculus. It examines problems like
how prime numbers are distributed and the claim that
every even number is a sum of two prime numbers. Algebraic number theory employs algebraic structures to analyze the properties of and relations between numbers. Examples are the use of
fields and
rings, as in
algebraic number fields like the
ring of integers. Geometric number theory uses concepts from geometry to study numbers. For instance, it investigates how lattice points with integer coordinates behave in a plane. Further branches of number theory are
probabilistic number theory, which employs methods from
probability theory,
combinatorial number theory, which relies on the field of
combinatorics,
computational number theory, which approaches number-theoretic problems with computational methods, and applied number theory, which examines the application of number theory to fields like
physics,
biology, and
cryptography. Influential theorems in number theory include the
fundamental theorem of arithmetic,
Euclid's theorem, and
Fermat's Last Theorem. According to the fundamental theorem of arithmetic, every integer greater than 1 is either a prime number or can be represented as a unique product of prime numbers. For example, the
number 18 is not a prime number and can be represented as 2 \times 3 \times 3, all of which are prime numbers. The
number 19, by contrast, is a prime number that has no other prime factorization. Euclid's theorem states that there are infinitely many prime numbers. Fermat's Last Theorem is the statement that no positive integer values exist for a, b, and c that solve the equation a^n + b^n = c^n if n is greater than 2.
Rational number arithmetic Rational number arithmetic is the branch of arithmetic that deals with the manipulation of numbers that can be expressed as a
ratio of two integers. Most arithmetic operations on rational numbers can be calculated by performing a series of integer arithmetic operations on the numerators and the denominators of the involved numbers. If two rational numbers have the same denominator then they can be added by adding their numerators and keeping the common denominator. For example, \tfrac{2}{7} + \tfrac{3}{7} = \tfrac{5}{7}. A similar procedure is used for subtraction. If the two numbers do not have the same denominator then they must be transformed to find a common denominator. This can be achieved by scaling the first number with the denominator of the second number while scaling the second number with the denominator of the first number. For instance, \tfrac{1}{3} + \tfrac{1}{2} = \tfrac{1 \cdot 2}{3 \cdot 2} + \tfrac{1 \cdot 3}{2 \cdot 3} = \tfrac{2}{6} + \tfrac{3}{6} = \tfrac{5}{6}. Two rational numbers are multiplied by multiplying their numerators and their denominators respectively, as in \tfrac{2}{3} \cdot \tfrac{2}{5} = \tfrac{2 \cdot 2}{3 \cdot 5} = \tfrac{4}{15}. Dividing one rational number by another can be achieved by multiplying the first number with the
reciprocal of the second number. This means that the numerator and the denominator of the second number change position. For example, \tfrac{3}{5} : \tfrac{2}{7} = \tfrac{3}{5} \cdot \tfrac{7}{2} = \tfrac{21}{10}. Unlike integer arithmetic, rational number arithmetic is closed under division as long as the divisor is not 0. Both integer arithmetic and rational number arithmetic are not closed under exponentiation and logarithm. One way to calculate exponentiation with a fractional exponent is to perform two separate calculations: one exponentiation using the numerator of the exponent followed by drawing the
nth root of the result based on the denominator of the exponent. For example, 5^\frac{2}{3} = \sqrt[3]{5^2}. The first operation can be completed using methods like repeated multiplication or exponentiation by squaring. One way to get an approximate result for the second operation is to employ
Newton's method, which uses a series of steps to gradually refine an initial guess until it reaches the desired level of accuracy. The Taylor series or the continued fraction method can be utilized to calculate logarithms. The
decimal fraction notation is a special way of representing rational numbers whose denominator is a power of 10. For instance, the rational numbers \tfrac{1}{10}, \tfrac{371}{100}, and \tfrac{44}{10000} are written as 0.1, 3.71, and 0.0044 in the decimal fraction notation. Modified versions of integer calculation methods like addition with carry and long multiplication can be applied to calculations with decimal fractions. Not all rational numbers have a finite representation in the decimal notation. For example, the rational number \tfrac{1}{3} corresponds to 0.333... with an infinite number of 3s. The shortened notation for this type of
repeating decimal is 0.. Every repeating decimal expresses a rational number.
Real number arithmetic Real number arithmetic is the branch of arithmetic that deals with the manipulation of both rational and irrational numbers. Irrational numbers are numbers that cannot be expressed through fractions or repeated decimals, like the root of 2 and Pi|. Unlike rational number arithmetic, real number arithmetic is closed under exponentiation as long as it uses a positive number as its base. The same is true for the logarithm of positive real numbers as long as the logarithm base is positive and not 1. Irrational numbers involve an infinite non-repeating series of decimal digits. Because of this, there is often no simple and accurate way to express the results of arithmetic operations like \sqrt{2} + \pi or {{nobr|e \cdot \sqrt{3}.}} In cases where absolute precision is not required, the problem of calculating arithmetic operations on real numbers is usually addressed by
truncation or
rounding. For truncation, a certain number of leftmost digits are kept and remaining digits are discarded or replaced by zeros. For example, the number has an infinite number of digits starting with 3.14159.... If this number is truncated to 4 decimal places, the result is 3.141. Rounding is a similar process in which the last preserved digit is increased by one if the next digit is 5 or greater but remains the same if the next digit is less than 5, so that the rounded number is the best approximation of a given precision for the original number. For instance, if the number is rounded to 4 decimal places, the result is 3.142 because the following digit is a 5, so 3.142 is closer to than 3.141. These methods allow computers to efficiently perform approximate calculations on real numbers.
Approximations and errors In science and engineering, numbers represent estimates of physical quantities derived from
measurement or modeling. Unlike mathematically exact numbers such as or scientifically relevant numerical data are inherently inexact, involving some
measurement uncertainty. One basic way to express the degree of certainty about each number's value and avoid
false precision is to round each measurement to a certain number of digits, called
significant digits, which are implied to be accurate. For example, a person's height measured with a
tape measure might only be precisely known to the nearest centimeter, so should be presented as 1.62 meters rather than 1.6217 meters. If converted to imperial units, this quantity should be rounded to 64 inches or 63.8 inches rather than 63.7795 inches, to clearly convey the precision of the measurement. When a number is written using ordinary decimal notation, leading zeros are not significant, and trailing zeros of numbers not written with a decimal point are implicitly considered to be non-significant. For example, the numbers 0.056 and 1200 each have only 2 significant digits, but the number 40.00 has 4 significant digits. Representing uncertainty using only significant digits is a relatively crude method, with some unintuitive subtleties; explicitly keeping track of an estimate or upper bound of the
approximation error is a more sophisticated approach. In the example, the person's height might be represented as meters or . In performing calculations with uncertain quantities, the
uncertainty should be propagated to calculated quantities. When adding or subtracting two or more quantities, add the
absolute uncertainties of each summand together to obtain the absolute uncertainty of the sum. When multiplying or dividing two or more quantities, add the
relative uncertainties of each factor together to obtain the relative uncertainty of the product. When representing uncertainty by significant digits, uncertainty can be coarsely propagated by rounding the result of adding or subtracting two or more quantities to the leftmost last significant decimal place among the summands, and by rounding the result of multiplying or dividing two or more quantities to the least number of significant digits among the factors. (See .) More sophisticated methods of dealing with uncertain values include
interval arithmetic and
affine arithmetic. Interval arithmetic describes operations on
intervals. Intervals can be used to represent a range of values if one does not know the precise magnitude, for example, because of
measurement errors. Interval arithmetic includes operations like addition and multiplication on intervals, as in [1, 2] + [3, 4] = [4, 6] and [1, 2] \times [3, 4] = [3, 8]. It is closely related to affine arithmetic, which aims to give more precise results by performing calculations on affine forms rather than intervals. An affine form is a number together with error terms that describe how the number may deviate from the actual magnitude. The precision of numerical quantities can be expressed uniformly using
normalized scientific notation, which is also convenient for concisely representing numbers which are much larger or smaller than 1. Using scientific notation, a number is decomposed into the product of a number between 1 and 10, called the
significand, and 10 raised to some integer power, called the
exponent. The significand consists of the significant digits of the number, and is written as a leading digit 1–9 followed by a decimal point and a sequence of digits 0–9. For example, the normalized scientific notation of the number 8276000 is 8.276 \times 10^6 with significand 8.276 and exponent 6, and the normalized scientific notation of the number 0.00735 is 7.35 \times 10^{-3} with significand 7.35 and exponent −3. Unlike ordinary decimal notation, where trailing zeros of large numbers are implicitly considered to be non-significant, in scientific notation every digit in the significand is considered significant, and adding trailing zeros indicates higher precision. For example, while the number 1200 implicitly has only 2 significant digits, the number explicitly has 3. A common method employed by computers to approximate real number arithmetic is called
floating-point arithmetic. It represents real numbers similar to the scientific notation through three numbers: a significand, a base, and an exponent. The precision of the significand is limited by the number of bits allocated to represent it. If an arithmetic operation results in a number that requires more bits than are available, the computer rounds the result to the closest representable number. This leads to
rounding errors. A consequence of this behavior is that certain laws of arithmetic are violated by floating-point arithmetic. For example, floating-point addition is not associative since the rounding errors introduced can depend on the order of the additions. This means that the result of (a + b) + c is sometimes different from the result of The most common technical standard used for floating-point arithmetic is called
IEEE 754. Among other things, it determines how numbers are represented, how arithmetic operations and rounding are performed, and how errors and exceptions are handled. In cases where computation speed is not a limiting factor, it is possible to use
arbitrary-precision arithmetic, for which the precision of calculations is only restricted by the computer's memory.
Tool use are done exclusively in the mind without relying on external aids. Forms of arithmetic can also be distinguished by the
tools employed to perform calculations and include many approaches besides the regular use of pen and paper.
Mental arithmetic relies exclusively on the
mind without external tools. Instead, it utilizes visualization, memorization, and certain calculation techniques to solve arithmetic problems. One such technique is the compensation method, which consists in altering the numbers to make the calculation easier and then adjusting the result afterward. For example, instead of calculating 85-47, one calculates 85-50 which is easier because it uses a round number. In the next step, one adds 3 to the result to compensate for the earlier adjustment. Mental arithmetic is often taught in primary education to train the numerical abilities of the students. The human body can also be employed as an arithmetic tool. The use of hands in
finger counting is often introduced to young children to teach them numbers and simple calculations. In its most basic form, the number of extended fingers corresponds to the represented quantity and arithmetic operations like addition and subtraction are performed by extending or retracting fingers. This system is limited to small numbers compared to more advanced systems which employ different approaches to represent larger quantities. The human voice is used as an arithmetic aid in verbal counting.
Tally marks are a simple system based on external tools other than the body. This system relies on mark making, such as strokes drawn on a surface or
notches carved into a wooden stick, to keep track of quantities. Some forms of tally marks arrange the strokes in groups of five to make them easier to read. The
abacus is a more advanced tool to represent numbers and perform calculations. An abacus usually consists of a series of rods, each holding several
beads. Each bead represents a quantity, which is counted if the bead is moved from one end of a rod to the other. Calculations happen by manipulating the positions of beads until the final bead pattern reveals the result. Related aids include
counting boards, which use tokens whose value depends on the area on the board in which they are placed, and
counting rods, which are arranged in horizontal and vertical patterns to represent different numbers.
Sectors and
slide rules are more refined calculating instruments that rely on geometric relationships between different scales to perform both basic and advanced arithmetic operations. Printed tables were particularly relevant as an aid to look up the results of operations like logarithm and
trigonometric functions.
Mechanical calculators automate manual calculation processes. They present the user with some form of input device to enter numbers by turning dials or pressing keys. They include an internal mechanism usually consisting of
gears,
levers, and
wheels to perform calculations and display the results. For
electronic calculators and
computers, this procedure is further refined by replacing the mechanical components with
electronic circuits like
microprocessors that combine and transform electric signals to perform calculations.
Others There are many other types of arithmetic.
Modular arithmetic operates on a finite set of numbers. If an operation would result in a number outside this finite set then the number is adjusted back into the set, similar to how the hands of clocks start at the beginning again after having completed one cycle. The number at which this adjustment happens is called the modulus. For example, a regular clock has a modulus of 12. In the case of adding 4 to 9, this means that the result is not 13 but 1. The same principle applies also to other operations, such as subtraction, multiplication, and division. Some forms of arithmetic deal with operations performed on mathematical objects other than numbers. Interval arithmetic describes operations on intervals. Vector arithmetic and matrix arithmetic describe arithmetic operations on
vectors and
matrices, like
vector addition and
matrix multiplication. Arithmetic systems can be classified based on the numeral system they rely on. For instance,
decimal arithmetic describes arithmetic operations in the decimal system. Other examples are
binary arithmetic,
octal arithmetic, and
hexadecimal arithmetic. Compound unit arithmetic describes arithmetic operations performed on magnitudes with compound units. It involves additional operations to govern the transformation between single unit and compound unit quantities. For example, the operation of reduction is used to transform the compound quantity 1 h 90 min into the single unit quantity 150 min. Non-Diophantine arithmetics are arithmetic systems that violate traditional arithmetic intuitions and include equations like 1 + 1 = 1 and 2 + 2 = 5. They can be employed to represent some real-world situations in modern physics and everyday life. For instance, the equation 1 + 1 = 1 can be used to describe the observation that if one raindrop is added to another raindrop then they do not remain two separate entities but become one. == Axiomatic foundations ==