# Negative and non-negative numbers

A negative number is a number that is less than zero, such as −3. A positive number is a number that is greater than zero, such as 3. Zero itself is neither negative nor positive, though in computing zero is sometimes treated as though it were a positive number. The non-negative numbers are the real numbers that are not negative (positive or zero). The non-positive numbers are the real numbers that are not positive (negative or zero).

In the context of complex numbers positive implies real, but for clarity one may say "positive real number".

## Negative numbers

Negative integers can be regarded as an extension of the natural numbers, such that the equation xy = z has a meaningful solution for all values of x and y. The other sets of numbers are then derived as progressively more elaborate extensions and generalizations from the integers.

Negative numbers are useful to describe values on a scale that goes below zero, such as temperature, and also in bookkeeping where they can be used to represent debts. In bookkeeping, debts are often represented by red numbers, or a number in parentheses.

## Non-negative numbers

A number is nonnegative if and only if it is greater than or equal to zero, i.e. positive or zero. Thus the nonnegative integers are all the integers from zero on upwards, and the nonnegative reals are all the real numbers from zero on upwards.

A real matrix A is called nonnegative if every entry of A is nonnegative.

A real matrix A is called totally nonnegative by matrix theorists or totally positive by computer scientists if the determinant of every square submatrix of A is nonnegative.

## Sign function

It is possible to define a function sgn(x) on the real numbers which is 1 for positive numbers, −1 for negative numbers and 0 for zero (sometimes called the signum function):

$\displaystyle \sgn(x)=\left\{\begin{matrix} -1 & : x < 0 \\ \;0 & : x = 0 \\ \;1 & : x > 0 \end{matrix}\right.$

We then have (except for x=0):

$\displaystyle \sgn(x) = \frac{x}{|x|} = \frac{|x|}{x} = \frac{d{|x|}}{d{x}} = 2H(x)-1.$

where |x| is the absolute value of x and H(x) is the Heaviside step function. See also derivative.

## Arithmetic involving signed numbers

For purposes of addition and subtraction, one can think of negative numbers as debts.

Adding a negative number is the same as subtracting the corresponding positive number:

$\displaystyle 5 + (-3) = 5 - 3 = 2 \,$
(if you have $5 and acquire a debt of$3, then you have a net worth of $2) $\displaystyle -2 + (-5) = -2 - 5 = -7 \,$ Subtracting a positive number from a smaller positive number yields a negative result: $\displaystyle 4 - 6 = -2 \,$ (if you have$4 and spend $6 then you have a debt of$2).

Subtracting a positive number from any negative number yields a negative result:

$\displaystyle -3 - 6 = -9 \,$
(if you have a debt of $3 and spend another$6, you have a debt of $9). Subtracting a negative is equivalent to adding the corresponding positive: $\displaystyle 5 - (-2) = 5 + 2 = 7 \,$ (if you have a net worth of$5 and you get rid of a debt of $2, then your new net worth is$7).

Also:

$\displaystyle (-8) - (-3) = -5 \,$
(if you have a debt of $8 and get rid of a debt of$3, then you still have a debt of $5). ### Multiplication Multiplication of a negative number by a positive number yields a negative result: (−2) × 3 = −6. The reason is that this multiplication can be understood as repeated addition: (−2) × 3 = (−2) + (−2) + (−2) = −6. Alternatively: if you have a debt of$2, and then your debt is tripled, you end up with a debt of \$6.

Multiplication of two negative numbers yields a positive result: (−3) × (−4) = 12. This situation cannot be understood as repeated addition, and the analogy to debts doesn't help either. The ultimate reason for this rule is that we want the distributive law to work:

$\displaystyle (3 + (-3)) \times (-4) = 3 \times (-4) + (-3) \times (-4). \,$

The left hand side of this equation equals 0 × (−4) = 0. The right hand side is a sum of −12 + (−3) × (−4); for the two to be equal, we need (−3) × (−4) = 12.

### Division

Division is similar to multiplication. If both the dividend and the divisor have different signs, the result is negative:

$\displaystyle \; 8 \;/\; (-2) = (-4) \,$
$\displaystyle (-10) \;/\; 2 = (-5) \,$

If both numbers are of the same sign, the result is positive (even if they are both negative):

$\displaystyle (-12) \;/\; (-3) = 4 \,$

## Formal construction of negative and non-negative integers

In a similar manner to rational numbers, we can extend the natural numbers N to the integers Z by defining integers as an ordered pair of natural numbers (a, b). We can extend addition and multiplication to these pairs with the following rules:

$\displaystyle ( a , b ) + ( c , d ) = ( a + c , b + d ) \,$
$\displaystyle ( a , b ) \times ( c , d ) = ( a \times c + b \times d , a \times d + b \times c ) \,$

We define an equivalence relation ~ upon these pairs with the following rule:

$\displaystyle (a, b)\sim(c, d)$ if and only if $\displaystyle a + d = b + c . \,$

This equivalence relation is compatible with the addition and multiplication defined above, and we may define Z to be the quotient set N2/~, i.e. we identify two pairs (a, b) and (c, d) if they are equivalent in the above sense.

We can also define a total order on Z by writing

$\displaystyle ( a , b ) \leq ( c , d ) \,$ if and only if $\displaystyle a + d \leq b + c . \,$

This will lead to an additive zero of the form (a, a), an additive inverse of (a, b) of the form (b, a), a multiplicative unit of the form (a+1, a), and a definition of subtraction

$\displaystyle ( a , b ) - ( c , d ) = ( a + d , b + c ). \,$

## First usage of negative numbers

For centuries, negative solutions to problems were considered “false” because they couldn't be found in the real world. The abstract concept was recognised as early as 100 BC - 50 BC. The Chinese ”Nine Chapters on the Mathematical Art” (Jiu-zhang Suanshu) contains methods for finding the areas of figures; red rods were used to denote positive coefficients, black for negative. This is the earliest known mention of negative numbers in the East, the first indication in a western work was in the 3rd century in Greece. Diophantus referred to the equation equivalent to $\displaystyle 4x + 20 = 0$ (the solution would be negative) in Arithmetica, saying that the equation gave an absurd result.

During the 600s, negative numbers were in use in India to represent debts. Diophantus’ previous reference was discussed more explicitly by Indian mathematician Brahmagupta, in Brahma-Sphuta-Siddhanta 628, who used negative numbers to produce the general form quadratic formula that remains in use today. However, in the 12th century in India, Bhaskara gives negative roots for quadratic equations but says the negative value "is in this case not to be taken, for it is inadequate; people do not approve of negative roots."

European mathematicians, for the most part, resisted the concept of negative numbers until the 17th century, although Fibonacci allowed negative solutions in financial problems where they could be interpreted as debits (chapter 13 of Liber Abaci, 1202) and later as losses (in Flos). At the same time, the Chinese were indicating negative numbers by drawing a diagonal stroke through the right-most nonzero digit. The first use of negative numbers in a European work was by Chuquet during the 15th century. He used them as exponents, but referred to them as “absurd numbers”

Negative numbers were not well-understood until modern times. As recently as the 18th century, the Swiss mathematician Leonhard Euler believed that negative numbers were greater than infinity, and it was common practice to ignore any negative results returned by equations on the assumption that they were meaningless.