−0 (number)
From Wikipedia, the free encyclopedia
|
−0 is the representation of negative zero or minus zero, a number that exists in computing, in some signed number representations for integers, and in most floating point number representations. In mathematical terms there is no concept of a negative (or positive) zero, and −0 is equivalent to, and represented as, zero. In common usage, −0 may be used to denote a negative number rounded to zero, or a number approaching zero from the negative direction. In statistical mechanics, certain systems in a state of population inversion may be considered to have an absolute temperature of −0, the hottest possible absolute temperature.
RepresentationsImage:IEEE 754 Single Negative Zero.svg
Negative zero by IEEE 754 representation in 32 bit
In a 1+7-bit sign-and-magnitude representation for integers, negative zero is represented by the binary value 10000000. In an 8-bit one's complement representation, negative zero is represented by the binary value 11111111. In IEEE 754 floating point numbers, negative zero is represented by the exponent and mantissa being zero and the sign bit being one. In IBM's General Decimal Arithmetic encoding specification, a floating point representation that uses decimal arithmetic, negative zero is represented by an exponent being any valid exponent in the range for the encoding, the coefficient being (densely packed encoded) all zeros, and the sign bit being one. Negative zero cannot be distinguished from positive zero with conventional two's complement encoding, which is the most common representation of signed binary integers. Properties and handlingIn programming languages such as C, C#, C++, and Java, whilst it is possible to obtain negative zero as the result of an expression (for instance as the result of arithmetic underflow on a negative number), negative zero and positive zero compare equal under default (numerical) comparison. Thus a simple comparison is not sufficient to test whether a number is negative zero. Ways of testing include
(for positive x)
(for positive x)
<source lang="java"> Double negativeZero = new Double(-0.0); negativeZero.equals(-0.0); // Result: true negativeZero.equals( 0.0); // Result: false </source>
(for positive x)
(for negative x)
(for negative x)
(for positive x)
Scientific usesIn meteorology, −0 can be used to indicate a temperature which is below zero, especially for the Celsius scale where below zero indicates freezing. It is often important for statistical reasons, when it is not low enough to be rounded to −1. An example of such a temperature is −0.2 degrees; this cannot be listed as zero degrees, because temperatures of zero degrees are obviously not considered below zero. However, a tally of below-zero days is often a rudimentary statistic in comparing the coldness of winter seasons, so it cannot be ignored. It is not low enough to be rounded to −1, so it is recorded as −0. In some contexts related to statistical mechanics, it is possible for systems to have a negative absolute temperature, but counterintuitively, these are not extremely cold, but rather extremely hot, hotter than any positive temperature. In this context, −0 is the hottest temperature there is. References
Further reading
eo:-0 ko:−0 lt:-0 ja:-0 pl:-0 ru:Отрицательный и положительный ноль th:−0 vi:-0 |


