<s>
Signed	B-Algorithm
zero	I-Algorithm
is	O
zero	O
with	O
an	O
associated	O
sign	O
.	O
</s>
<s>
In	O
ordinary	O
arithmetic	O
,	O
the	O
number	O
0	O
does	O
not	O
have	O
a	O
sign	O
,	O
so	O
that	O
−0	B-Algorithm
,	O
+0	B-Algorithm
and	O
0	O
are	O
identical	O
.	O
</s>
<s>
However	O
,	O
in	O
computing	O
,	O
some	O
number	O
representations	O
allow	O
for	O
the	O
existence	O
of	O
two	O
zeros	O
,	O
often	O
denoted	O
by	O
−0	B-Algorithm
(	O
negative	B-Algorithm
zero	I-Algorithm
)	O
and	O
+0	B-Algorithm
(	O
positive	O
zero	O
)	O
,	O
regarded	O
as	O
equal	O
by	O
the	O
numerical	O
comparison	O
operations	O
but	O
with	O
possible	O
different	O
behaviors	O
in	O
particular	O
operations	O
.	O
</s>
<s>
This	O
occurs	O
in	O
the	O
sign-magnitude	O
and	O
ones	O
 '	O
complement	O
signed	B-Algorithm
number	I-Algorithm
representations	I-Algorithm
for	O
integers	O
,	O
and	O
in	O
most	O
floating-point	B-Algorithm
number	I-Algorithm
representations	O
.	O
</s>
<s>
The	O
number	O
0	O
is	O
usually	O
encoded	O
as	O
+0	B-Algorithm
,	O
but	O
can	O
be	O
represented	O
by	O
either	O
+0	B-Algorithm
or	O
−0	B-Algorithm
.	O
</s>
<s>
The	O
IEEE	O
754	O
standard	O
for	O
floating-point	B-Algorithm
arithmetic	I-Algorithm
(	O
presently	O
used	O
by	O
most	O
computers	O
and	O
programming	O
languages	O
that	O
support	O
floating-point	B-Algorithm
numbers	I-Algorithm
)	O
requires	O
both	O
+0	B-Algorithm
and	O
−0	B-Algorithm
.	O
</s>
<s>
Real	O
arithmetic	O
with	O
signed	B-Algorithm
zeros	I-Algorithm
can	O
be	O
considered	O
a	O
variant	O
of	O
the	O
extended	O
real	O
number	O
line	O
such	O
that	O
1/	O
−0	B-Algorithm
=	O
−∞	O
and	O
1/	O
+0	B-Algorithm
=	O
+∞	O
;	O
division	O
is	O
only	O
undefined	B-Algorithm
for	O
±	O
0/	O
±0	O
and	O
±∞	O
/	O
±∞	O
.	O
</s>
<s>
Negatively	O
signed	B-Algorithm
zero	I-Algorithm
echoes	O
the	O
mathematical	O
analysis	O
concept	O
of	O
approaching	O
0	O
from	O
below	O
as	O
a	O
one-sided	B-Algorithm
limit	I-Algorithm
,	O
which	O
may	O
be	O
denoted	O
by	O
x	O
→	O
0−	O
,	O
x	O
→	O
0−	O
,	O
or	O
x	O
→↑	O
0	O
.	O
</s>
<s>
The	O
notation	O
"	O
−0	B-Algorithm
"	O
may	O
be	O
used	O
informally	O
to	O
denote	O
a	O
negative	O
number	O
that	O
has	O
been	O
rounded	B-Algorithm
to	O
zero	O
.	O
</s>
<s>
The	O
concept	O
of	O
negative	B-Algorithm
zero	I-Algorithm
also	O
has	O
some	O
theoretical	O
applications	O
in	O
statistical	O
mechanics	O
and	O
other	O
disciplines	O
.	O
</s>
<s>
It	O
is	O
claimed	O
that	O
the	O
inclusion	O
of	O
signed	B-Algorithm
zero	I-Algorithm
in	O
IEEE754	O
makes	O
it	O
much	O
easier	O
to	O
achieve	O
numerical	O
accuracy	O
in	O
some	O
critical	O
problems	O
,	O
in	O
particular	O
when	O
computing	O
with	O
complex	O
elementary	O
functions	O
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
the	O
concept	O
of	O
signed	B-Algorithm
zero	I-Algorithm
runs	O
contrary	O
to	O
the	O
usual	O
assumption	O
made	O
in	O
mathematics	O
that	O
negative	B-Algorithm
zero	I-Algorithm
is	O
the	O
same	O
value	O
as	O
zero	O
.	O
</s>
<s>
Representations	O
that	O
allow	O
negative	B-Algorithm
zero	I-Algorithm
can	O
be	O
a	O
source	O
of	O
errors	O
in	O
programs	O
,	O
if	O
software	O
developers	O
do	O
not	O
take	O
into	O
account	O
that	O
while	O
the	O
two	O
zero	O
representations	O
behave	O
as	O
equal	O
under	O
numeric	B-Algorithm
comparisons	O
,	O
they	O
yield	O
different	O
results	O
in	O
some	O
operations	O
.	O
</s>
<s>
Binary	O
integer	O
formats	O
can	O
use	O
various	B-Algorithm
encodings	I-Algorithm
.	O
</s>
<s>
In	O
the	O
widely	O
used	O
two	B-General_Concept
's	I-General_Concept
complement	I-General_Concept
encoding	O
,	O
zero	O
is	O
unsigned	O
.	O
</s>
<s>
In	O
a	O
1+	O
7-bit	O
sign-and-magnitude	O
representation	O
for	O
integers	O
,	O
negative	B-Algorithm
zero	I-Algorithm
is	O
represented	O
by	O
the	O
bit	O
string	O
.	O
</s>
<s>
In	O
an	O
8-bit	O
ones	O
 '	O
complement	O
representation	O
,	O
negative	B-Algorithm
zero	I-Algorithm
is	O
represented	O
by	O
the	O
bit	O
string	O
.	O
</s>
<s>
However	O
,	O
the	O
latter	O
two	O
encodings	O
(	O
with	O
a	O
signed	B-Algorithm
zero	I-Algorithm
)	O
are	O
uncommon	O
for	O
integer	O
formats	O
.	O
</s>
<s>
The	O
most	O
common	O
formats	O
with	O
a	O
signed	B-Algorithm
zero	I-Algorithm
are	O
floating-point	B-Algorithm
formats	I-Algorithm
(	O
IEEE	O
754	O
formats	O
or	O
similar	O
)	O
,	O
described	O
below	O
.	O
</s>
<s>
In	O
IEEE	O
754	O
binary	B-Algorithm
floating-point	I-Algorithm
formats	O
,	O
zero	O
values	O
are	O
represented	O
by	O
the	O
biased	O
exponent	O
and	O
significand	B-Algorithm
both	O
being	O
zero	O
.	O
</s>
<s>
Negative	B-Algorithm
zero	I-Algorithm
has	O
the	O
sign	O
bit	O
set	O
to	O
one	O
.	O
</s>
<s>
One	O
may	O
obtain	O
negative	B-Algorithm
zero	I-Algorithm
as	O
the	O
result	O
of	O
certain	O
computations	O
,	O
for	O
instance	O
as	O
the	O
result	O
of	O
arithmetic	B-Algorithm
underflow	I-Algorithm
on	O
a	O
negative	O
number	O
(	O
other	O
results	O
may	O
also	O
be	O
possible	O
)	O
,	O
or	O
−	O
1.0	O
×	O
0.0	O
,	O
or	O
simply	O
as	O
−	O
0.0	O
.	O
</s>
<s>
In	O
IEEE	O
754	O
decimal	O
floating-point	B-Algorithm
formats	I-Algorithm
,	O
a	O
negative	B-Algorithm
zero	I-Algorithm
is	O
represented	O
by	O
an	O
exponent	O
being	O
any	O
valid	O
exponent	O
in	O
the	O
range	O
for	O
the	O
format	O
,	O
the	O
true	O
significand	B-Algorithm
being	O
zero	O
,	O
and	O
the	O
sign	O
bit	O
being	O
one	O
.	O
</s>
<s>
The	O
IEEE	O
754	O
floating-point	B-Algorithm
standard	O
specifies	O
the	O
behavior	O
of	O
positive	O
zero	O
and	O
negative	B-Algorithm
zero	I-Algorithm
under	O
various	O
operations	O
.	O
</s>
<s>
The	O
outcome	O
may	O
depend	O
on	O
the	O
current	O
IEEE	O
rounding	B-Algorithm
mode	O
settings	O
.	O
</s>
<s>
In	O
systems	O
that	O
include	O
both	O
signed	O
and	O
unsigned	O
zeros	O
,	O
the	O
notation	O
and	O
is	O
sometimes	O
used	O
for	O
signed	B-Algorithm
zeros	I-Algorithm
.	O
</s>
<s>
The	O
sign	O
below	O
shows	O
the	O
obtained	O
floating-point	B-Algorithm
results	O
(	O
it	O
is	O
not	O
the	O
usual	O
equality	O
operator	O
)	O
.	O
</s>
<s>
There	O
are	O
special	O
rules	O
for	O
adding	O
or	O
subtracting	O
signed	B-Algorithm
zero	I-Algorithm
:	O
</s>
<s>
Because	O
of	O
negative	B-Algorithm
zero	I-Algorithm
(	O
and	O
also	O
when	O
the	O
rounding	B-Algorithm
mode	O
is	O
upward	O
or	O
downward	O
)	O
,	O
the	O
expressions	O
and	O
,	O
for	O
floating-point	B-Algorithm
variables	O
x	O
and	O
y	O
,	O
cannot	O
be	O
replaced	O
by	O
.	O
</s>
<s>
However	O
can	O
be	O
replaced	O
by	O
x	O
with	O
rounding	B-Algorithm
to	O
nearest	O
(	O
except	O
when	O
x	O
can	O
be	O
a	O
signaling	O
NaN	O
)	O
.	O
</s>
<s>
Division	O
of	O
a	O
non-zero	O
number	O
by	O
zero	O
sets	O
the	O
divide	B-Algorithm
by	I-Algorithm
zero	I-Algorithm
flag	O
,	O
and	O
an	O
operation	O
producing	O
a	O
NaN	O
sets	O
the	O
invalid	O
operation	O
flag	O
.	O
</s>
<s>
An	O
exception	B-General_Concept
handler	I-General_Concept
is	O
called	O
if	O
enabled	O
for	O
the	O
corresponding	O
flag	O
.	O
</s>
<s>
According	O
to	O
the	O
IEEE754	O
standard	O
,	O
negative	B-Algorithm
zero	I-Algorithm
and	O
positive	O
zero	O
should	O
compare	O
as	O
equal	O
with	O
the	O
usual	O
(	O
numerical	O
)	O
comparison	O
operators	O
,	O
like	O
the	O
==	O
operators	O
of	O
C	B-Language
and	O
Java	B-Language
.	O
</s>
<s>
Type	B-Language
punning	I-Language
the	O
number	O
to	O
an	O
integer	O
type	O
,	O
so	O
as	O
to	O
look	O
at	O
the	O
sign	O
bit	O
in	O
the	O
bit	O
pattern	O
;	O
</s>
<s>
using	O
the	O
ISO	O
C	B-Language
copysign( )	O
function	O
(	O
IEEE754	O
copySign	O
operation	O
)	O
to	O
copy	O
the	O
sign	O
of	O
the	O
zero	O
to	O
some	O
non-zero	O
number	O
;	O
</s>
<s>
using	O
the	O
ISO	O
C	B-Language
signbit( )	O
macro	O
(	O
IEEE754	O
isSignMinus	O
operation	O
)	O
that	O
returns	O
whether	O
the	O
sign	O
bit	O
of	O
a	O
number	O
is	O
set	O
;	O
</s>
<s>
taking	O
the	O
reciprocal	O
of	O
the	O
zero	O
to	O
obtain	O
either	O
1/	O
( +0	O
)	O
=	O
+∞	O
or	O
1/	O
( −0	O
)	O
=	O
−∞	O
(	O
if	O
the	O
division	B-Algorithm
by	I-Algorithm
zero	I-Algorithm
exception	O
is	O
not	O
trapped	O
)	O
.	O
</s>
<s>
Note	O
:	O
Casting	O
to	O
integral	O
type	O
will	O
not	O
always	O
work	O
,	O
especially	O
on	O
two	B-General_Concept
's	I-General_Concept
complement	I-General_Concept
systems	I-General_Concept
.	O
</s>
<s>
This	O
is	O
the	O
case	O
,	O
for	O
example	O
,	O
of	O
the	O
method	O
in	O
Java	B-Language
's	O
Double	O
wrapper	B-Language
class	I-Language
.	O
</s>
<s>
Informally	O
,	O
one	O
may	O
use	O
the	O
notation	O
"	O
−0	B-Algorithm
"	O
for	O
a	O
negative	O
value	O
that	O
was	O
rounded	B-Algorithm
to	O
zero	O
.	O
</s>
<s>
This	O
notation	O
may	O
be	O
useful	O
when	O
a	O
negative	O
sign	O
is	O
significant	O
;	O
for	O
example	O
,	O
when	O
tabulating	O
Celsius	B-Operating_System
temperatures	O
,	O
where	O
a	O
negative	O
sign	O
means	O
below	O
freezing	O
.	O
</s>
<s>
In	O
statistical	O
mechanics	O
,	O
one	O
sometimes	O
uses	O
negative	O
temperatures	O
to	O
describe	O
systems	O
with	O
population	O
inversion	O
,	O
which	O
can	O
be	O
considered	O
to	O
have	O
a	O
temperature	O
greater	O
than	O
positive	O
infinity	B-Application
,	O
because	O
the	O
coefficient	O
of	O
energy	O
in	O
the	O
population	O
distribution	O
function	O
is	O
1/Temperature	O
.	O
</s>
<s>
In	O
this	O
context	O
,	O
a	O
temperature	O
of	O
0	O
is	O
a	O
(	O
theoretical	O
)	O
temperature	O
larger	O
than	O
any	O
other	O
negative	O
temperature	O
,	O
corresponding	O
to	O
the	O
(	O
theoretical	O
)	O
maximum	O
conceivable	O
extent	O
of	O
population	O
inversion	O
,	O
the	O
opposite	O
extreme	O
to	O
+0	B-Algorithm
.	O
</s>
