<s>
In	O
computing	O
,	O
floating-point	B-Algorithm
arithmetic	I-Algorithm
(	O
FP	O
)	O
is	O
arithmetic	O
that	O
represents	O
real	O
numbers	O
approximately	O
,	O
using	O
an	O
integer	O
with	O
a	O
fixed	O
precision	B-Architecture
,	O
called	O
the	O
significand	B-Algorithm
,	O
scaled	O
by	O
an	O
integer	O
exponent	O
of	O
a	O
fixed	O
base	O
.	O
</s>
<s>
For	O
example	O
,	O
12.345	O
can	O
be	O
represented	O
as	O
a	O
base-ten	O
floating-point	B-Algorithm
number	I-Algorithm
:	O
</s>
<s>
In	O
practice	O
,	O
most	O
floating-point	B-Algorithm
systems	O
use	O
base	O
two	O
,	O
though	O
base	O
ten	O
(	O
decimal	O
floating	B-Algorithm
point	I-Algorithm
)	O
is	O
also	O
common	O
.	O
</s>
<s>
The	O
term	O
floating	B-Algorithm
point	I-Algorithm
refers	O
to	O
the	O
fact	O
that	O
the	O
number	O
's	O
radix	B-Algorithm
point	I-Algorithm
can	O
"	O
float	B-Algorithm
"	O
anywhere	O
to	O
the	O
left	O
,	O
right	O
,	O
or	O
between	O
the	O
significant	B-Architecture
digits	I-Architecture
of	O
the	O
number	O
.	O
</s>
<s>
This	O
position	O
is	O
indicated	O
by	O
the	O
exponent	O
,	O
so	O
floating	B-Algorithm
point	I-Algorithm
can	O
be	O
considered	O
a	O
form	O
of	O
scientific	O
notation	O
.	O
</s>
<s>
A	O
floating-point	B-Algorithm
system	O
can	O
be	O
used	O
to	O
represent	O
,	O
with	O
a	O
fixed	O
number	O
of	O
digits	O
,	O
numbers	O
of	O
very	O
different	O
orders	O
of	O
magnitude	O
—	O
such	O
as	O
the	O
number	O
of	O
meters	O
between	O
galaxies	O
or	O
between	O
protons	B-Application
in	O
an	O
atom	O
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
floating-point	B-Algorithm
arithmetic	I-Algorithm
is	O
often	O
used	O
to	O
allow	O
very	O
small	O
and	O
very	O
large	O
real	O
numbers	O
that	O
require	O
fast	O
processing	O
times	O
.	O
</s>
<s>
Over	O
the	O
years	O
,	O
a	O
variety	O
of	O
floating-point	B-Algorithm
representations	I-Algorithm
have	O
been	O
used	O
in	O
computers	O
.	O
</s>
<s>
In	O
1985	O
,	O
the	O
IEEE	O
754	O
Standard	O
for	O
Floating-Point	B-Algorithm
Arithmetic	I-Algorithm
was	O
established	O
,	O
and	O
since	O
the	O
1990s	O
,	O
the	O
most	O
commonly	O
encountered	O
representations	O
are	O
those	O
defined	O
by	O
the	O
IEEE	O
.	O
</s>
<s>
The	O
speed	O
of	O
floating-point	B-Algorithm
operations	O
,	O
commonly	O
measured	O
in	O
terms	O
of	O
FLOPS	O
,	O
is	O
an	O
important	O
characteristic	O
of	O
a	O
computer	O
system	O
,	O
especially	O
for	O
applications	O
that	O
involve	O
intensive	O
mathematical	O
calculations	O
.	O
</s>
<s>
A	O
floating-point	B-General_Concept
unit	I-General_Concept
(	O
FPU	O
,	O
colloquially	O
a	O
math	B-General_Concept
coprocessor	I-General_Concept
)	O
is	O
a	O
part	O
of	O
a	O
computer	O
system	O
specially	O
designed	O
to	O
carry	O
out	O
operations	O
on	O
floating-point	B-Algorithm
numbers	I-Algorithm
.	O
</s>
<s>
In	O
standard	O
mathematical	O
notation	O
,	O
the	O
digit	O
string	O
can	O
be	O
of	O
any	O
length	O
,	O
and	O
the	O
location	O
of	O
the	O
radix	B-Algorithm
point	I-Algorithm
is	O
indicated	O
by	O
placing	O
an	O
explicit	O
"	O
point	O
"	O
character	O
(	O
dot	O
or	O
comma	O
)	O
there	O
.	O
</s>
<s>
If	O
the	O
radix	B-Algorithm
point	I-Algorithm
is	O
not	O
specified	O
,	O
then	O
the	O
string	O
implicitly	O
represents	O
an	O
integer	O
and	O
the	O
unstated	O
radix	B-Algorithm
point	I-Algorithm
would	O
be	O
off	O
the	O
right-hand	O
end	O
of	O
the	O
string	O
,	O
next	O
to	O
the	O
least	O
significant	B-Architecture
digit	I-Architecture
.	O
</s>
<s>
In	O
fixed-point	O
systems	O
,	O
a	O
position	O
in	O
the	O
string	O
is	O
specified	O
for	O
the	O
radix	B-Algorithm
point	I-Algorithm
.	O
</s>
<s>
In	O
scientific	O
notation	O
,	O
the	O
given	O
number	O
is	O
scaled	O
by	O
a	O
power	O
of	O
10	O
,	O
so	O
that	O
it	O
lies	O
within	O
a	O
specific	O
range	O
—	O
typically	O
between	O
1	O
and	O
10	O
,	O
with	O
the	O
radix	B-Algorithm
point	I-Algorithm
appearing	O
immediately	O
after	O
the	O
first	B-Architecture
digit	I-Architecture
.	O
</s>
<s>
Floating-point	B-Algorithm
representation	I-Algorithm
is	O
similar	O
in	O
concept	O
to	O
scientific	O
notation	O
.	O
</s>
<s>
Logically	O
,	O
a	O
floating-point	B-Algorithm
number	I-Algorithm
consists	O
of	O
:	O
</s>
<s>
This	O
digit	O
string	O
is	O
referred	O
to	O
as	O
the	O
significand	B-Algorithm
,	O
mantissa	B-Algorithm
,	O
or	O
coefficient	O
.	O
</s>
<s>
The	O
length	O
of	O
the	O
significand	B-Algorithm
determines	O
the	O
precision	B-Architecture
to	O
which	O
numbers	O
can	O
be	O
represented	O
.	O
</s>
<s>
The	O
radix	B-Algorithm
point	I-Algorithm
position	O
is	O
assumed	O
always	O
to	O
be	O
somewhere	O
within	O
the	O
significand	B-Algorithm
—	O
often	O
just	O
after	O
or	O
just	O
before	O
the	O
most	O
significant	B-Architecture
digit	I-Architecture
,	O
or	O
to	O
the	O
right	O
of	O
the	O
rightmost	O
(	O
least	O
significant	O
)	O
digit	O
.	O
</s>
<s>
This	O
article	O
generally	O
follows	O
the	O
convention	O
that	O
the	O
radix	B-Algorithm
point	I-Algorithm
is	O
set	O
just	O
after	O
the	O
most	O
significant	O
(	O
leftmost	O
)	O
digit	O
.	O
</s>
<s>
To	O
derive	O
the	O
value	O
of	O
the	O
floating-point	B-Algorithm
number	I-Algorithm
,	O
the	O
significand	B-Algorithm
is	O
multiplied	O
by	O
the	O
base	O
raised	O
to	O
the	O
power	O
of	O
the	O
exponent	O
,	O
equivalent	O
to	O
shifting	O
the	O
radix	B-Algorithm
point	I-Algorithm
from	O
its	O
implied	O
position	O
by	O
a	O
number	O
of	O
places	O
equal	O
to	O
the	O
value	O
of	O
the	O
exponent	O
—	O
to	O
the	O
right	O
if	O
the	O
exponent	O
is	O
positive	O
or	O
to	O
the	O
left	O
if	O
the	O
exponent	O
is	O
negative	O
.	O
</s>
<s>
Using	O
base-10	O
(	O
the	O
familiar	O
decimal	O
notation	O
)	O
as	O
an	O
example	O
,	O
the	O
number	O
,	O
which	O
has	O
ten	O
decimal	O
digits	O
of	O
precision	B-Architecture
,	O
is	O
represented	O
as	O
the	O
significand	B-Algorithm
together	O
with	O
5	O
as	O
the	O
exponent	O
.	O
</s>
<s>
To	O
determine	O
the	O
actual	O
value	O
,	O
a	O
decimal	O
point	O
is	O
placed	O
after	O
the	O
first	B-Architecture
digit	I-Architecture
of	O
the	O
significand	B-Algorithm
and	O
the	O
result	O
is	O
multiplied	O
by	O
to	O
give	O
,	O
or	O
.	O
</s>
<s>
where	O
is	O
the	O
significand	B-Algorithm
(	O
ignoring	O
any	O
implied	O
decimal	O
point	O
)	O
,	O
is	O
the	O
precision	B-Architecture
(	O
the	O
number	O
of	O
digits	O
in	O
the	O
significand	B-Algorithm
)	O
,	O
is	O
the	O
base	O
(	O
in	O
our	O
example	O
,	O
this	O
is	O
the	O
number	O
ten	O
)	O
,	O
and	O
is	O
the	O
exponent	O
.	O
</s>
<s>
Historically	O
,	O
several	O
number	O
bases	O
have	O
been	O
used	O
for	O
representing	O
floating-point	B-Algorithm
numbers	I-Algorithm
,	O
with	O
base	O
two	O
(	O
binary	O
)	O
being	O
the	O
most	O
common	O
,	O
followed	O
by	O
base	O
ten	O
(	O
decimal	O
floating	B-Algorithm
point	I-Algorithm
)	O
,	O
and	O
other	O
less	O
common	O
varieties	O
,	O
such	O
as	O
base	O
sixteen	O
(	O
hexadecimal	B-Device
floating	I-Device
point	I-Device
)	O
,	O
base	O
eight	O
(	O
octal	O
floating	B-Algorithm
point	I-Algorithm
)	O
,	O
base	O
four	O
(	O
quaternary	O
floating	B-Algorithm
point	I-Algorithm
)	O
,	O
base	O
three	O
(	O
balanced	B-Device
ternary	I-Device
floating	I-Device
point	I-Device
)	O
and	O
even	O
base	O
256	O
and	O
base	O
.	O
</s>
<s>
A	O
floating-point	B-Algorithm
number	I-Algorithm
is	O
a	O
rational	O
number	O
,	O
because	O
it	O
can	O
be	O
represented	O
as	O
one	O
integer	O
divided	O
by	O
another	O
;	O
for	O
example	O
is	O
(	O
145/100	O
)	O
×1000	O
or	O
/100	O
.	O
</s>
<s>
The	O
base	O
determines	O
the	O
fractions	O
that	O
can	O
be	O
represented	O
;	O
for	O
instance	O
,	O
1/5	O
cannot	O
be	O
represented	O
exactly	O
as	O
a	O
floating-point	B-Algorithm
number	I-Algorithm
using	O
a	O
binary	O
base	O
,	O
but	O
1/5	O
can	O
be	O
represented	O
exactly	O
using	O
a	O
decimal	O
base	O
(	O
,	O
or	O
)	O
.	O
</s>
<s>
However	O
,	O
1/3	O
cannot	O
be	O
represented	O
exactly	O
by	O
either	O
binary	O
(	O
010101	O
...	O
)	O
or	O
decimal	O
(	O
333	O
...	O
)	O
,	O
but	O
in	O
base	B-Algorithm
3	I-Algorithm
,	O
it	O
is	O
trivial	O
(	O
0.1	O
or	O
1×3−1	O
)	O
.	O
</s>
<s>
The	O
way	O
in	O
which	O
the	O
significand	B-Algorithm
(	O
including	O
its	O
sign	O
)	O
and	O
exponent	O
are	O
stored	O
in	O
a	O
computer	O
is	O
implementation-dependent	O
.	O
</s>
<s>
The	O
common	O
IEEE	O
formats	O
are	O
described	O
in	O
detail	O
later	O
and	O
elsewhere	O
,	O
but	O
as	O
an	O
example	O
,	O
in	O
the	O
binary	O
single-precision	O
(	O
32-bit	O
)	O
floating-point	B-Algorithm
representation	I-Algorithm
,	O
,	O
and	O
so	O
the	O
significand	B-Algorithm
is	O
a	O
string	O
of	O
24	O
bits	O
.	O
</s>
<s>
The	O
24-bit	O
significand	B-Algorithm
will	O
stop	O
at	O
position23	O
,	O
shown	O
as	O
the	O
underlined	O
bit	O
above	O
.	O
</s>
<s>
The	O
next	O
bit	O
,	O
at	O
position24	O
,	O
is	O
called	O
the	O
round	O
bit	O
or	O
rounding	B-Algorithm
bit	O
.	O
</s>
<s>
When	O
this	O
is	O
stored	O
in	O
memory	O
using	O
the	O
IEEE	O
754	O
encoding	O
,	O
this	O
becomes	O
the	O
significand	B-Algorithm
.	O
</s>
<s>
The	O
significand	B-Algorithm
is	O
assumed	O
to	O
have	O
a	O
binary	O
point	O
to	O
the	O
right	O
of	O
the	O
leftmost	O
bit	O
.	O
</s>
<s>
where	O
is	O
the	O
precision	B-Architecture
(	O
in	O
this	O
example	O
)	O
,	O
is	O
the	O
position	O
of	O
the	O
bit	O
of	O
the	O
significand	B-Algorithm
from	O
the	O
left	O
(	O
starting	O
at	O
and	O
finishing	O
at	O
here	O
)	O
and	O
is	O
the	O
exponent	O
(	O
in	O
this	O
example	O
)	O
.	O
</s>
<s>
It	O
can	O
be	O
required	O
that	O
the	O
most	O
significant	B-Architecture
digit	I-Architecture
of	O
the	O
significand	B-Algorithm
of	O
a	O
non-zero	O
number	O
be	O
non-zero	O
(	O
except	O
when	O
the	O
corresponding	O
exponent	O
would	O
be	O
smaller	O
than	O
the	O
minimum	O
one	O
)	O
.	O
</s>
<s>
Therefore	O
,	O
it	O
does	O
not	O
need	O
to	O
be	O
represented	O
in	O
memory	O
,	O
allowing	O
the	O
format	O
to	O
have	O
one	O
more	O
bit	O
of	O
precision	B-Architecture
.	O
</s>
<s>
The	O
floating-point	B-Algorithm
representation	I-Algorithm
is	O
by	O
far	O
the	O
most	O
common	O
way	O
of	O
representing	O
in	O
computers	O
an	O
approximation	O
to	O
real	O
numbers	O
.	O
</s>
<s>
The	O
hardware	O
to	O
manipulate	O
these	O
representations	O
is	O
less	O
costly	O
than	O
floating	B-Algorithm
point	I-Algorithm
,	O
and	O
it	O
can	O
be	O
used	O
to	O
perform	O
normal	O
integer	O
operations	O
,	O
too	O
.	O
</s>
<s>
The	O
value	O
distribution	O
is	O
similar	O
to	O
floating	B-Algorithm
point	I-Algorithm
,	O
but	O
the	O
value-to-representation	O
curve	O
(	O
i.e.	O
,	O
the	O
graph	O
of	O
the	O
logarithm	O
function	O
)	O
is	O
smooth	O
(	O
except	O
at	O
0	O
)	O
.	O
</s>
<s>
Conversely	O
to	O
floating-point	B-Algorithm
arithmetic	I-Algorithm
,	O
in	O
a	O
logarithmic	O
number	O
system	O
multiplication	O
,	O
division	O
and	O
exponentiation	O
are	O
simple	O
to	O
implement	O
,	O
but	O
addition	O
and	O
subtraction	O
are	O
complex	O
.	O
</s>
<s>
The	O
(	O
symmetric	B-Algorithm
)	O
level-index	B-Algorithm
arithmetic	I-Algorithm
(	O
LI	O
and	O
SLI	O
)	O
of	O
Charles	O
Clenshaw	O
,	O
Frank	O
Olver	O
and	O
Peter	O
Turner	O
is	O
a	O
scheme	O
based	O
on	O
a	O
generalized	B-Algorithm
logarithm	I-Algorithm
representation	O
.	O
</s>
<s>
Tapered	B-Algorithm
floating-point	I-Algorithm
representation	I-Algorithm
,	O
which	O
does	O
not	O
appear	O
to	O
be	O
used	O
in	O
practice	O
.	O
</s>
<s>
Some	O
simple	O
rational	O
numbers	O
(	O
e.g.	O
,	O
1/3	O
and	O
1/10	O
)	O
cannot	O
be	O
represented	O
exactly	O
in	O
binary	B-Algorithm
floating	I-Algorithm
point	I-Algorithm
,	O
no	O
matter	O
what	O
the	O
precision	B-Architecture
is	O
.	O
</s>
<s>
Using	O
a	O
different	O
radix	O
allows	O
one	O
to	O
represent	O
some	O
of	O
them	O
(	O
e.g.	O
,	O
1/10	O
in	O
decimal	O
floating	B-Algorithm
point	I-Algorithm
)	O
,	O
but	O
the	O
possibilities	O
remain	O
limited	O
.	O
</s>
<s>
Such	O
packages	O
generally	O
need	O
to	O
use	O
"	O
bignum	B-Algorithm
"	O
arithmetic	O
for	O
the	O
individual	O
integers	O
.	O
</s>
<s>
Interval	B-Algorithm
arithmetic	I-Algorithm
allows	O
one	O
to	O
represent	O
numbers	O
as	O
intervals	O
and	O
obtain	O
guaranteed	O
bounds	O
on	O
results	O
.	O
</s>
<s>
It	O
is	O
generally	O
based	O
on	O
other	O
arithmetics	O
,	O
in	O
particular	O
floating	B-Algorithm
point	I-Algorithm
.	O
</s>
<s>
Computer	B-General_Concept
algebra	I-General_Concept
systems	I-General_Concept
such	O
as	O
Mathematica	B-Language
,	O
Maxima	B-Language
,	O
and	O
Maple	B-Language
can	O
often	O
handle	O
irrational	O
numbers	O
like	O
or	O
in	O
a	O
completely	O
"	O
formal	O
"	O
way	O
(	O
symbolic	B-Algorithm
computation	I-Algorithm
)	O
,	O
without	O
dealing	O
with	O
a	O
specific	O
encoding	O
of	O
the	O
significand	B-Algorithm
.	O
</s>
<s>
In	O
1914	O
,	O
Leonardo	O
Torres	O
y	O
Quevedo	O
proposed	O
a	O
form	O
of	O
floating	B-Algorithm
point	I-Algorithm
in	O
the	O
course	O
of	O
discussing	O
his	O
design	O
for	O
a	O
special-purpose	O
electromechanical	O
calculator	O
.	O
</s>
<s>
In	O
1938	O
,	O
Konrad	O
Zuse	O
of	O
Berlin	O
completed	O
the	O
Z1	B-Device
,	O
the	O
first	O
binary	O
,	O
programmable	O
mechanical	B-Device
computer	I-Device
;	O
it	O
uses	O
a	O
24-bit	O
binary	B-Algorithm
floating-point	I-Algorithm
number	I-Algorithm
representation	O
with	O
a	O
7-bit	O
signed	O
exponent	O
,	O
a	O
17-bit	O
significand	B-Algorithm
(	O
including	O
one	O
implicit	O
bit	O
)	O
,	O
and	O
a	O
sign	O
bit	O
.	O
</s>
<s>
The	O
more	O
reliable	O
relay-based	O
Z3	B-Device
,	O
completed	O
in	O
1941	O
,	O
has	O
representations	O
for	O
both	O
positive	O
and	O
negative	O
infinities	O
;	O
in	O
particular	O
,	O
it	O
implements	O
defined	O
operations	O
with	O
infinity	B-Application
,	O
such	O
as	O
,	O
and	O
it	O
stops	O
on	O
undefined	O
operations	O
,	O
such	O
as	O
.	O
</s>
<s>
Zuse	O
also	O
proposed	O
,	O
but	O
did	O
not	O
complete	O
,	O
carefully	O
rounded	O
floating-point	B-Algorithm
arithmetic	I-Algorithm
that	O
includes	O
and	O
NaN	O
representations	O
,	O
anticipating	O
features	O
of	O
the	O
IEEE	O
Standard	O
by	O
four	O
decades	O
.	O
</s>
<s>
In	O
contrast	O
,	O
von	O
Neumann	O
recommended	O
against	O
floating-point	B-Algorithm
numbers	I-Algorithm
for	O
the	O
1951	O
IAS	B-Device
machine	I-Device
,	O
arguing	O
that	O
fixed-point	O
arithmetic	O
is	O
preferable	O
.	O
</s>
<s>
The	O
first	O
commercial	O
computer	O
with	O
floating-point	B-Algorithm
hardware	O
was	O
Zuse	O
's	O
Z4	B-Device
computer	O
,	O
designed	O
in	O
1942	O
–	O
1945	O
.	O
</s>
<s>
In	O
1946	O
,	O
Bell	O
Laboratories	O
introduced	O
the	O
MarkV	O
,	O
which	O
implemented	O
decimal	O
floating-point	B-Algorithm
numbers	I-Algorithm
.	O
</s>
<s>
The	O
Pilot	B-Device
ACE	I-Device
has	O
binary	B-Algorithm
floating-point	I-Algorithm
arithmetic	I-Algorithm
,	O
and	O
it	O
became	O
operational	O
in	O
1950	O
at	O
National	O
Physical	O
Laboratory	O
,	O
UK	O
.	O
</s>
<s>
Thirty-three	O
were	O
later	O
sold	O
commercially	O
as	O
the	O
English	B-Device
Electric	I-Device
DEUCE	I-Device
.	O
</s>
<s>
The	O
arithmetic	O
is	O
actually	O
implemented	O
in	O
software	O
,	O
but	O
with	O
a	O
one	O
megahertz	O
clock	O
rate	O
,	O
the	O
speed	O
of	O
floating-point	B-Algorithm
and	O
fixed-point	O
operations	O
in	O
this	O
machine	O
were	O
initially	O
faster	O
than	O
those	O
of	O
many	O
competing	O
computers	O
.	O
</s>
<s>
The	O
mass-produced	O
IBM	B-Device
704	I-Device
followed	O
in	O
1954	O
;	O
it	O
introduced	O
the	O
use	O
of	O
a	O
biased	B-Algorithm
exponent	I-Algorithm
.	O
</s>
<s>
For	O
many	O
decades	O
after	O
that	O
,	O
floating-point	B-Algorithm
hardware	O
was	O
typically	O
an	O
optional	O
feature	O
,	O
and	O
computers	O
that	O
had	O
it	O
were	O
said	O
to	O
be	O
"	O
scientific	O
computers	O
"	O
,	O
or	O
to	O
have	O
"	O
scientific	O
computation	O
"	O
(	O
SC	O
)	O
capability	O
(	O
see	O
also	O
Extensions	O
for	O
Scientific	O
Computation	O
(	O
XSC	O
)	O
)	O
.	O
</s>
<s>
It	O
was	O
not	O
until	O
the	O
launch	O
of	O
the	O
Intel	O
i486	O
in	O
1989	O
that	O
general-purpose	O
personal	O
computers	O
had	O
floating-point	B-Algorithm
capability	O
in	O
hardware	O
as	O
a	O
standard	O
feature	O
.	O
</s>
<s>
The	O
UNIVAC	B-Device
1100/2200	I-Device
series	I-Device
,	O
introduced	O
in	O
1962	O
,	O
supported	O
two	O
floating-point	B-Algorithm
representations	I-Algorithm
:	O
</s>
<s>
Single	O
precision	B-Architecture
:	O
36	O
bits	O
,	O
organized	O
as	O
a	O
1-bit	O
sign	O
,	O
an	O
8-bit	O
exponent	O
,	O
and	O
a	O
27-bit	O
significand	B-Algorithm
.	O
</s>
<s>
Double	O
precision	B-Architecture
:	O
72	O
bits	O
,	O
organized	O
as	O
a	O
1-bit	O
sign	O
,	O
an	O
11-bit	O
exponent	O
,	O
and	O
a	O
60-bit	O
significand	B-Algorithm
.	O
</s>
<s>
The	O
IBM	B-Device
7094	I-Device
,	O
also	O
introduced	O
in	O
1962	O
,	O
supported	O
single-precision	O
and	O
double-precision	O
representations	O
,	O
but	O
with	O
no	O
relation	O
to	O
the	O
UNIVAC	O
's	O
representations	O
.	O
</s>
<s>
Indeed	O
,	O
in	O
1964	O
,	O
IBM	O
introduced	O
hexadecimal	B-Device
floating-point	I-Device
representations	I-Device
in	O
its	O
System/360	B-Application
mainframes	O
;	O
these	O
same	O
representations	O
are	O
still	O
available	O
for	O
use	O
in	O
modern	O
z/Architecture	B-Device
systems	O
.	O
</s>
<s>
In	O
1998	O
,	O
IBM	O
implemented	O
IEEE-compatible	O
binary	B-Algorithm
floating-point	I-Algorithm
arithmetic	I-Algorithm
in	O
its	O
mainframes	O
;	O
in	O
2005	O
,	O
IBM	O
also	O
added	O
IEEE-compatible	O
decimal	O
floating-point	B-Algorithm
arithmetic	I-Algorithm
.	O
</s>
<s>
Initially	O
,	O
computers	O
used	O
many	O
different	O
representations	O
for	O
floating-point	B-Algorithm
numbers	I-Algorithm
.	O
</s>
<s>
The	O
lack	O
of	O
standardization	O
at	O
the	O
mainframe	O
level	O
was	O
an	O
ongoing	O
problem	O
by	O
the	O
early	O
1970s	O
for	O
those	O
writing	O
and	O
maintaining	O
higher-level	O
source	O
code	O
;	O
these	O
manufacturer	O
floating-point	B-Algorithm
standards	O
differed	O
in	O
the	O
word	O
sizes	O
,	O
the	O
representations	O
,	O
and	O
the	O
rounding	B-Algorithm
behavior	O
and	O
general	O
accuracy	O
of	O
operations	O
.	O
</s>
<s>
Floating-point	B-Algorithm
compatibility	O
across	O
multiple	O
computing	O
systems	O
was	O
in	O
desperate	O
need	O
of	O
standardization	O
by	O
the	O
early	O
1980s	O
,	O
leading	O
to	O
the	O
creation	O
of	O
the	O
IEEE	O
754	O
standard	O
once	O
the	O
32-bit	O
(	O
or	O
64-bit	O
)	O
word	O
had	O
become	O
commonplace	O
.	O
</s>
<s>
This	O
standard	O
was	O
significantly	O
based	O
on	O
a	O
proposal	O
from	O
Intel	O
,	O
which	O
was	O
designing	O
the	O
i8087	B-Device
numerical	O
coprocessor	B-General_Concept
;	O
Motorola	O
,	O
which	O
was	O
designing	O
the	O
68000	B-Device
around	O
the	O
same	O
time	O
,	O
gave	O
significant	O
input	O
as	O
well	O
.	O
</s>
<s>
Among	O
the	O
x86	B-Operating_System
innovations	O
are	O
these	O
:	O
</s>
<s>
A	O
precisely	O
specified	O
floating-point	B-Algorithm
representation	I-Algorithm
at	O
the	O
bit-string	O
level	O
,	O
so	O
that	O
all	O
compliant	O
computers	O
interpret	O
bit	O
patterns	O
the	O
same	O
way	O
.	O
</s>
<s>
This	O
makes	O
it	O
possible	O
to	O
accurately	O
and	O
efficiently	O
transfer	O
floating-point	B-Algorithm
numbers	I-Algorithm
from	O
one	O
computer	O
to	O
another	O
(	O
after	O
accounting	O
for	O
endianness	O
)	O
.	O
</s>
<s>
This	O
means	B-Operating_System
that	O
a	O
compliant	O
computer	O
program	O
would	O
always	O
produce	O
the	O
same	O
result	O
when	O
given	O
a	O
particular	O
input	O
,	O
thus	O
mitigating	O
the	O
almost	O
mystical	O
reputation	O
that	O
floating-point	B-Algorithm
computation	O
had	O
developed	O
for	O
its	O
hitherto	O
seemingly	O
non-deterministic	O
behavior	O
.	O
</s>
<s>
The	O
ability	O
of	O
exceptional	O
conditions	O
(	O
overflow	O
,	O
divide	B-Algorithm
by	I-Algorithm
zero	I-Algorithm
,	O
etc	O
.	O
)	O
</s>
<s>
A	O
floating-point	B-Algorithm
number	I-Algorithm
consists	O
of	O
two	O
fixed-point	O
components	O
,	O
whose	O
range	O
depends	O
exclusively	O
on	O
the	O
number	O
of	O
bits	O
or	O
digits	O
in	O
their	O
representation	O
.	O
</s>
<s>
Whereas	O
components	O
linearly	O
depend	O
on	O
their	O
range	O
,	O
the	O
floating-point	B-Algorithm
range	O
linearly	O
depends	O
on	O
the	O
significand	B-Algorithm
range	O
and	O
exponentially	O
on	O
the	O
range	O
of	O
exponent	O
component	O
,	O
which	O
attaches	O
outstandingly	O
wider	O
range	O
to	O
the	O
number	O
.	O
</s>
<s>
On	O
a	O
typical	O
computer	O
system	O
,	O
a	O
double-precision	O
(	O
64-bit	O
)	O
binary	B-Algorithm
floating-point	I-Algorithm
number	I-Algorithm
has	O
a	O
coefficient	O
of	O
53	O
bits	O
(	O
including	O
1	O
implied	O
bit	O
)	O
,	O
an	O
exponent	O
of	O
11	O
bits	O
,	O
and	O
1	O
sign	O
bit	O
.	O
</s>
<s>
Since	O
210	O
=	O
1024	O
,	O
the	O
complete	O
range	O
of	O
the	O
positive	O
normal	O
floating-point	B-Algorithm
numbers	I-Algorithm
in	O
this	O
format	O
is	O
from	O
2−1022≈2×10−308	O
to	O
approximately	O
21024≈2×10308	O
.	O
</s>
<s>
P	O
is	O
the	O
precision	B-Architecture
of	O
the	O
significand	B-Algorithm
(	O
in	O
base	O
B	O
)	O
,	O
</s>
<s>
There	O
is	O
a	O
smallest	O
positive	O
normal	O
floating-point	B-Algorithm
number	I-Algorithm
,	O
</s>
<s>
Underflow	B-Algorithm
level	O
=	O
UFL	O
=	O
,	O
</s>
<s>
which	O
has	O
a	O
1	O
as	O
the	O
leading	B-Architecture
digit	I-Architecture
and	O
0	O
for	O
the	O
remaining	O
digits	O
of	O
the	O
significand	B-Algorithm
,	O
and	O
the	O
smallest	O
possible	O
value	O
for	O
the	O
exponent	O
.	O
</s>
<s>
There	O
is	O
a	O
largest	O
floating-point	B-Algorithm
number	I-Algorithm
,	O
</s>
<s>
which	O
has	O
B	O
−	O
1	O
as	O
the	O
value	O
for	O
each	O
digit	O
of	O
the	O
significand	B-Algorithm
and	O
the	O
largest	O
possible	O
value	O
for	O
the	O
exponent	O
.	O
</s>
<s>
Namely	O
,	O
positive	B-Algorithm
and	I-Algorithm
negative	I-Algorithm
zeros	I-Algorithm
,	O
as	O
well	O
as	O
subnormal	B-Algorithm
numbers	I-Algorithm
.	O
</s>
<s>
The	O
IEEE	O
standardized	O
the	O
computer	O
representation	O
for	O
binary	B-Algorithm
floating-point	I-Algorithm
numbers	I-Algorithm
in	O
IEEE	O
754	O
(	O
a.k.a.	O
</s>
<s>
IBM	O
mainframes	O
support	O
IBM	B-Device
's	I-Device
own	I-Device
hexadecimal	I-Device
floating	I-Device
point	I-Device
format	I-Device
and	O
IEEE	O
754-2008	O
decimal	O
floating	B-Algorithm
point	I-Algorithm
in	O
addition	O
to	O
the	O
IEEE	O
754	O
binary	O
format	O
.	O
</s>
<s>
The	O
Cray	B-Device
T90	I-Device
series	O
had	O
an	O
IEEE	O
version	O
,	O
but	O
the	O
SV1	B-Device
still	O
uses	O
Cray	O
floating-point	B-Algorithm
format	I-Algorithm
.	O
</s>
<s>
Five	O
of	O
these	O
formats	O
are	O
called	O
basic	O
formats	O
,	O
and	O
others	O
are	O
termed	O
extended	B-Algorithm
precision	I-Algorithm
formats	I-Algorithm
and	O
extendable	O
precision	B-Architecture
format	O
.	O
</s>
<s>
Single	O
precision	B-Architecture
(	O
binary32	O
)	O
,	O
usually	O
used	O
to	O
represent	O
the	O
"	O
float	B-Algorithm
"	O
type	O
in	O
the	O
C	B-Language
language	I-Language
family	O
.	O
</s>
<s>
This	O
is	O
a	O
binary	O
format	O
that	O
occupies	O
32	O
bits	O
(	O
4	O
bytes	O
)	O
and	O
its	O
significand	B-Algorithm
has	O
a	O
precision	B-Architecture
of	O
24	O
bits	O
(	O
about	O
7	B-Device
decimal	O
digits	O
)	O
.	O
</s>
<s>
Double	O
precision	B-Architecture
(	O
binary64	O
)	O
,	O
usually	O
used	O
to	O
represent	O
the	O
"	O
double	O
"	O
type	O
in	O
the	O
C	B-Language
language	I-Language
family	O
.	O
</s>
<s>
This	O
is	O
a	O
binary	O
format	O
that	O
occupies	O
64	O
bits	O
(	O
8	O
bytes	O
)	O
and	O
its	O
significand	B-Algorithm
has	O
a	O
precision	B-Architecture
of	O
53	O
bits	O
(	O
about	O
16	O
decimal	O
digits	O
)	O
.	O
</s>
<s>
Double	B-Algorithm
extended	I-Algorithm
,	O
also	O
ambiguously	O
called	O
"	O
extended	B-Algorithm
precision	I-Algorithm
"	O
format	O
.	O
</s>
<s>
This	O
is	O
a	O
binary	O
format	O
that	O
occupies	O
at	O
least	O
79	O
bits	O
(	O
80	O
if	O
the	O
hidden/implicit	O
bit	O
rule	O
is	O
not	O
used	O
)	O
and	O
its	O
significand	B-Algorithm
has	O
a	O
precision	B-Architecture
of	O
at	O
least	O
64	O
bits	O
(	O
about	O
19	O
decimal	O
digits	O
)	O
.	O
</s>
<s>
The	O
C99	B-Language
and	O
C11	O
standards	O
of	O
the	O
C	B-Language
language	I-Language
family	O
,	O
in	O
their	O
annex	O
F	O
(	O
"	O
IEC	O
60559	O
floating-point	B-Algorithm
arithmetic	I-Algorithm
"	O
)	O
,	O
recommend	O
such	O
an	O
extended	O
format	O
to	O
be	O
provided	O
as	O
"	O
long	B-Language
double	I-Language
"	O
.	O
</s>
<s>
A	O
format	O
satisfying	O
the	O
minimal	O
requirements	O
(	O
64-bit	O
significand	B-Algorithm
precision	B-Architecture
,	O
15-bit	O
exponent	O
,	O
thus	O
fitting	O
on	O
80	O
bits	O
)	O
is	O
provided	O
by	O
the	O
x86	B-Operating_System
architecture	I-Operating_System
.	O
</s>
<s>
Often	O
on	O
such	O
processors	O
,	O
this	O
format	O
can	O
be	O
used	O
with	O
"	O
long	B-Language
double	I-Language
"	O
,	O
though	O
extended	B-Algorithm
precision	I-Algorithm
is	O
not	O
available	O
with	O
MSVC	O
.	O
</s>
<s>
For	O
alignment	B-Application
purposes	O
,	O
many	O
tools	O
store	O
this	O
80-bit	O
value	O
in	O
a	O
96-bit	O
or	O
128-bit	O
space	O
.	O
</s>
<s>
On	O
other	O
processors	O
,	O
"	O
long	B-Language
double	I-Language
"	O
may	O
stand	O
for	O
a	O
larger	O
format	O
,	O
such	O
as	O
quadruple	O
precision	B-Architecture
,	O
or	O
just	O
double	O
precision	B-Architecture
,	O
if	O
any	O
form	O
of	O
extended	B-Algorithm
precision	I-Algorithm
is	O
not	O
available	O
.	O
</s>
<s>
Increasing	O
the	O
precision	B-Architecture
of	O
the	O
floating-point	B-Algorithm
representation	I-Algorithm
generally	O
reduces	O
the	O
amount	O
of	O
accumulated	O
round-off	B-Algorithm
error	I-Algorithm
caused	O
by	O
intermediate	O
calculations	O
.	O
</s>
<s>
Quadruple	O
precision	B-Architecture
(	O
binary128	O
)	O
.	O
</s>
<s>
This	O
is	O
a	O
binary	O
format	O
that	O
occupies	O
128	O
bits	O
(	O
16	O
bytes	O
)	O
and	O
its	O
significand	B-Algorithm
has	O
a	O
precision	B-Architecture
of	O
113	O
bits	O
(	O
about	O
34	O
decimal	O
digits	O
)	O
.	O
</s>
<s>
Decimal64	O
and	O
decimal128	O
floating-point	B-Algorithm
formats	I-Algorithm
.	O
</s>
<s>
These	O
formats	O
,	O
along	O
with	O
the	O
decimal32	O
format	O
,	O
are	O
intended	O
for	O
performing	O
decimal	O
rounding	B-Algorithm
correctly	O
.	O
</s>
<s>
Half	O
precision	B-Architecture
,	O
also	O
called	O
binary16	O
,	O
a	O
16-bit	O
floating-point	B-Algorithm
value	O
.	O
</s>
<s>
It	O
is	O
being	O
used	O
in	O
the	O
NVIDIA	B-Language
Cg	I-Language
graphics	O
language	O
,	O
and	O
in	O
the	O
openEXR	O
standard	O
.	O
</s>
<s>
Any	O
integer	O
with	O
absolute	O
value	O
less	O
than	O
224	O
can	O
be	O
exactly	O
represented	O
in	O
the	O
single-precision	O
format	O
,	O
and	O
any	O
integer	O
with	O
absolute	O
value	O
less	O
than	O
253	O
can	O
be	O
exactly	O
represented	O
in	O
the	O
double-precision	O
format	O
.	O
</s>
<s>
These	O
properties	O
are	O
sometimes	O
used	O
for	O
purely	O
integer	O
data	O
,	O
to	O
get	O
53-bit	O
integers	O
on	O
platforms	O
that	O
have	O
double-precision	O
floats	B-Algorithm
but	O
only	O
32-bit	O
integers	O
.	O
</s>
<s>
The	O
standard	O
specifies	O
some	O
special	O
values	O
,	O
and	O
their	O
representation	O
:	O
positive	O
infinity	B-Application
(	O
)	O
,	O
negative	O
infinity	B-Application
(	O
)	O
,	O
a	O
negative	B-Algorithm
zero	I-Algorithm
( −0	O
)	O
distinct	O
from	O
ordinary	O
(	O
"	O
positive	O
"	O
)	O
zero	O
,	O
and	O
"	O
not	O
a	O
number	O
"	O
values	O
(	O
NaNs	O
)	O
.	O
</s>
<s>
Comparison	O
of	O
floating-point	B-Algorithm
numbers	I-Algorithm
,	O
as	O
defined	O
by	O
the	O
IEEE	O
standard	O
,	O
is	O
a	O
bit	O
different	O
from	O
usual	O
integer	O
comparison	O
.	O
</s>
<s>
Negative	O
and	O
positive	O
zero	O
compare	O
equal	O
,	O
and	O
every	O
NaN	O
compares	O
unequal	O
to	O
every	O
value	O
,	O
including	O
itself	O
.	O
</s>
<s>
All	O
finite	O
floating-point	B-Algorithm
numbers	I-Algorithm
are	O
strictly	O
smaller	O
than	O
and	O
strictly	O
greater	O
than	O
,	O
and	O
they	O
are	O
ordered	O
in	O
the	O
same	O
way	O
as	O
their	O
values	O
(	O
in	O
the	O
set	O
of	O
real	O
numbers	O
)	O
.	O
</s>
<s>
Floating-point	B-Algorithm
numbers	I-Algorithm
are	O
typically	O
packed	O
into	O
a	O
computer	O
datum	O
as	O
the	O
sign	O
bit	O
,	O
the	O
exponent	O
field	O
,	O
and	O
the	O
significand	B-Algorithm
or	O
mantissa	B-Algorithm
,	O
from	O
left	O
to	O
right	O
.	O
</s>
<s>
Values	O
of	O
all	O
0s	O
in	O
this	O
field	O
are	O
reserved	O
for	O
the	O
zeros	O
and	O
subnormal	B-Algorithm
numbers	I-Algorithm
;	O
values	O
of	O
all	O
1s	O
are	O
reserved	O
for	O
the	O
infinities	O
and	O
NaNs	O
.	O
</s>
<s>
The	O
exponent	O
range	O
for	O
normal	O
numbers	O
is	O
[ −126	O
,	O
127 ]	O
for	O
single	O
precision	B-Architecture
,	O
[ −1022	O
,	O
1023 ]	O
for	O
double	O
,	O
or	O
[ −16382	O
,	O
16383 ]	O
for	O
quad	O
.	O
</s>
<s>
Normal	O
numbers	O
exclude	O
subnormal	O
values	O
,	O
zeros	O
,	O
infinities	O
,	O
and	O
NaNs	O
.	O
</s>
<s>
In	O
the	O
IEEE	O
binary	O
interchange	O
formats	O
the	O
leading	O
1	O
bit	O
of	O
a	O
normalized	B-Algorithm
significand	I-Algorithm
is	O
not	O
actually	O
stored	O
in	O
the	O
computer	O
datum	O
.	O
</s>
<s>
Because	O
of	O
this	O
,	O
the	O
single-precision	O
format	O
actually	O
has	O
a	O
significand	B-Algorithm
with	O
24	O
bits	O
of	O
precision	B-Architecture
,	O
the	O
double-precision	O
format	O
has	O
53	O
,	O
and	O
quad	O
has	O
113	O
.	O
</s>
<s>
For	O
example	O
,	O
it	O
was	O
shown	O
above	O
that	O
π	O
,	O
rounded	O
to	O
24	O
bits	O
of	O
precision	B-Architecture
,	O
has	O
:	O
</s>
<s>
In	O
addition	O
to	O
the	O
widely	O
used	O
IEEE	O
754	O
standard	O
formats	O
,	O
other	O
floating-point	B-Algorithm
formats	I-Algorithm
are	O
used	O
,	O
or	O
have	O
been	O
used	O
,	O
in	O
certain	O
domain-specific	O
areas	O
.	O
</s>
<s>
The	O
Microsoft	O
Binary	O
Format	O
(	O
MBF	O
)	O
was	O
developed	O
for	O
the	O
Microsoft	O
BASIC	O
language	O
products	O
,	O
including	O
Microsoft	O
's	O
first	O
ever	O
product	O
the	O
Altair	B-Language
BASIC	I-Language
(	O
1975	O
)	O
,	O
TRS-80	B-Device
LEVEL	I-Device
II	I-Device
,	O
CP/M	B-Application
'	O
s	O
MBASIC	B-Language
,	O
IBM	B-Device
PC	I-Device
5150	I-Device
's	O
BASICA	O
,	O
MS-DOS	B-Application
'	O
s	O
GW-BASIC	B-Language
and	O
QuickBASIC	B-Language
prior	O
to	O
version	O
4.00	O
.	O
</s>
<s>
QuickBASIC	B-Language
version	O
4.00	O
and	O
4.50	O
switched	O
to	O
the	O
IEEE	O
754-1985	O
format	O
but	O
can	O
revert	O
to	O
the	O
MBF	O
format	O
using	O
the	O
/MBF	O
command	O
option	O
.	O
</s>
<s>
MBF	O
was	O
designed	O
and	O
developed	O
on	O
a	O
simulated	O
Intel	B-General_Concept
8080	I-General_Concept
by	O
Monte	O
Davidoff	O
,	O
a	O
dormmate	O
of	O
Bill	O
Gates	O
,	O
during	O
spring	O
of	O
1975	O
for	O
the	O
MITS	B-Architecture
Altair	I-Architecture
8800	I-Architecture
.	O
</s>
<s>
The	O
initial	O
release	O
of	O
July	O
1975	O
supported	O
a	O
single-precision	O
(	O
32	O
bits	O
)	O
format	O
due	O
to	O
cost	O
of	O
the	O
MITS	B-Architecture
Altair	I-Architecture
8800	I-Architecture
4-kilobytes	O
memory	O
.	O
</s>
<s>
In	O
December	O
1975	O
,	O
the	O
8-kilobytes	O
version	O
added	O
a	O
double-precision	O
(	O
64	O
bits	O
)	O
format	O
.	O
</s>
<s>
A	O
single-precision	O
(	O
40	O
bits	O
)	O
variant	O
format	O
was	O
adopted	O
for	O
other	O
CPU	O
's	O
,	O
notably	O
the	O
MOS	B-General_Concept
6502	I-General_Concept
(	O
Apple	B-Device
//	I-Device
,	O
Commodore	B-Device
PET	I-Device
,	O
Atari	O
)	O
,	O
Motorola	B-Device
6800	I-Device
(	O
MITS	B-Architecture
Altair	I-Architecture
680	O
)	O
and	O
Motorola	B-Device
6809	I-Device
(	O
TRS-80	B-Device
Color	I-Device
Computer	I-Device
)	O
.	O
</s>
<s>
MBF	O
consists	O
of	O
the	O
MBF	O
single-precision	O
format	O
(	O
32	O
bits	O
,	O
"	O
6-digit	O
BASIC	O
"	O
)	O
,	O
the	O
MBF	O
extended-precision	B-Algorithm
format	I-Algorithm
(	O
40	O
bits	O
,	O
"	O
9-digit	O
BASIC	O
"	O
)	O
,	O
and	O
the	O
MBF	O
double-precision	O
format	O
(	O
64	O
bits	O
)	O
;	O
each	O
of	O
them	O
is	O
represented	O
with	O
an	O
8-bit	O
exponent	O
,	O
followed	O
by	O
a	O
sign	O
bit	O
,	O
followed	O
by	O
a	O
significand	B-Algorithm
of	O
respectively	O
23	O
,	O
31	O
,	O
and	O
55	O
bits	O
.	O
</s>
<s>
The	O
Bfloat16	O
format	O
requires	O
the	O
same	O
amount	O
of	O
memory	O
(	O
16	O
bits	O
)	O
as	O
the	O
IEEE	O
754	O
half-precision	O
format	O
,	O
but	O
allocates	O
8	O
bits	O
to	O
the	O
exponent	O
instead	O
of	O
5	O
,	O
thus	O
providing	O
the	O
same	O
range	O
as	O
a	O
IEEE	O
754	O
single-precision	O
number	O
.	O
</s>
<s>
The	O
tradeoff	O
is	O
a	O
reduced	O
precision	B-Architecture
,	O
as	O
the	O
trailing	O
significand	B-Algorithm
field	O
is	O
reduced	O
from	O
10	O
to	O
7	B-Device
bits	O
.	O
</s>
<s>
This	O
format	O
is	O
mainly	O
used	O
in	O
the	O
training	O
of	O
machine	O
learning	O
models	O
,	O
where	O
range	O
is	O
more	O
valuable	O
than	O
precision	B-Architecture
.	O
</s>
<s>
The	O
TensorFloat-32	O
format	O
combines	O
the	O
8	O
bits	O
of	O
exponent	O
of	O
the	O
Bfloat16	O
with	O
the	O
10	O
bits	O
of	O
trailing	O
significand	B-Algorithm
field	O
of	O
half-precision	O
formats	O
,	O
resulting	O
in	O
a	O
size	O
of	O
19	O
bits	O
.	O
</s>
<s>
This	O
format	O
was	O
introduced	O
by	O
Nvidia	O
,	O
which	O
provides	O
hardware	O
support	O
for	O
it	O
in	O
the	O
Tensor	O
Cores	O
of	O
its	O
GPUs	B-Architecture
based	O
on	O
the	O
Nvidia	O
Ampere	O
architecture	O
.	O
</s>
<s>
However	O
,	O
according	O
to	O
Nvidia	O
,	O
this	O
format	O
should	O
only	O
be	O
used	O
internally	O
by	O
hardware	O
to	O
speed	O
up	O
computations	O
,	O
while	O
inputs	O
and	O
outputs	O
should	O
be	O
stored	O
in	O
the	O
32-bit	O
single-precision	O
IEEE	O
754	O
format	O
.	O
</s>
<s>
The	O
Hopper	B-General_Concept
architecture	O
GPUs	B-Architecture
provide	O
two	O
FP8	O
formats	O
:	O
one	O
with	O
the	O
same	O
numerical	O
range	O
as	O
half-precision	O
(	O
E5M2	O
)	O
and	O
one	O
with	O
higher	O
precision	B-Architecture
,	O
but	O
less	O
range	O
(	O
E4M3	O
)	O
.	O
</s>
<s>
By	O
their	O
nature	O
,	O
all	O
numbers	O
expressed	O
in	O
floating-point	B-Algorithm
format	I-Algorithm
are	O
rational	O
numbers	O
with	O
a	O
terminating	O
expansion	O
in	O
the	O
relevant	O
base	O
(	O
for	O
example	O
,	O
a	O
terminating	O
decimal	O
expansion	O
in	O
base-10	O
,	O
or	O
a	O
terminating	O
binary	O
expansion	O
in	O
base-2	O
)	O
.	O
</s>
<s>
The	O
number	O
of	O
digits	O
(	O
or	O
bits	O
)	O
of	O
precision	B-Architecture
also	O
limits	O
the	O
set	O
of	O
rational	O
numbers	O
that	O
can	O
be	O
represented	O
exactly	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
decimal	O
number	O
123456789	O
cannot	O
be	O
exactly	O
represented	O
if	O
only	O
eight	O
decimal	O
digits	O
of	O
precision	B-Architecture
are	O
available	O
(	O
it	O
would	O
be	O
rounded	O
to	O
one	O
of	O
the	O
two	O
straddling	O
representable	O
values	O
,	O
12345678×101	O
or	O
12345679×101	O
)	O
,	O
the	O
same	O
applies	O
to	O
non-terminating	O
digits	O
(	O
.	O
</s>
<s>
When	O
a	O
number	O
is	O
represented	O
in	O
some	O
format	O
(	O
such	O
as	O
a	O
character	O
string	O
)	O
which	O
is	O
not	O
a	O
native	O
floating-point	B-Algorithm
representation	I-Algorithm
supported	O
in	O
a	O
computer	O
implementation	O
,	O
then	O
it	O
will	O
require	O
a	O
conversion	O
before	O
it	O
can	O
be	O
used	O
in	O
that	O
implementation	O
.	O
</s>
<s>
If	O
the	O
number	O
can	O
be	O
represented	O
exactly	O
in	O
the	O
floating-point	B-Algorithm
format	I-Algorithm
then	O
the	O
conversion	O
is	O
exact	O
.	O
</s>
<s>
If	O
there	O
is	O
not	O
an	O
exact	O
representation	O
then	O
the	O
conversion	O
requires	O
a	O
choice	O
of	O
which	O
floating-point	B-Algorithm
number	I-Algorithm
to	O
use	O
to	O
represent	O
the	O
original	O
value	O
.	O
</s>
<s>
This	O
means	B-Operating_System
that	O
numbers	O
that	O
appear	O
to	O
be	O
short	O
and	O
exact	O
when	O
written	O
in	O
decimal	O
format	O
may	O
need	O
to	O
be	O
approximated	O
when	O
converted	O
to	O
binary	B-Algorithm
floating-point	I-Algorithm
.	O
</s>
<s>
For	O
example	O
,	O
the	O
decimal	O
number	O
0.1	O
is	O
not	O
representable	O
in	O
binary	B-Algorithm
floating-point	I-Algorithm
of	O
any	O
finite	O
precision	B-Architecture
;	O
the	O
exact	O
binary	O
representation	O
would	O
have	O
a	O
"	O
1100	O
"	O
sequence	O
continuing	O
endlessly	O
:	O
</s>
<s>
where	O
,	O
as	O
previously	O
,	O
s	O
is	O
the	O
significand	B-Algorithm
and	O
e	O
is	O
the	O
exponent	O
.	O
</s>
<s>
when	O
approximated	O
by	O
rounding	B-Algorithm
to	O
a	O
precision	B-Architecture
of	O
24	O
bits	O
.	O
</s>
<s>
In	O
binary	O
single-precision	O
floating-point	B-Algorithm
,	O
this	O
is	O
represented	O
as	O
s=	O
1.10010010000111111011011	O
with	O
e	O
=	O
1	O
.	O
</s>
<s>
The	O
result	O
of	O
rounding	B-Algorithm
differs	O
from	O
the	O
true	O
value	O
by	O
about	O
0.03	O
parts	O
per	O
million	O
,	O
and	O
matches	O
the	O
decimal	O
representation	O
of	O
π	O
in	O
the	O
first	O
7	B-Device
digits	O
.	O
</s>
<s>
The	O
difference	O
is	O
the	O
discretization	B-Algorithm
error	I-Algorithm
and	O
is	O
limited	O
by	O
the	O
machine	B-Algorithm
epsilon	I-Algorithm
.	O
</s>
<s>
The	O
arithmetical	O
difference	O
between	O
two	O
consecutive	O
representable	O
floating-point	B-Algorithm
numbers	I-Algorithm
which	O
have	O
the	O
same	O
exponent	O
is	O
called	O
a	O
unit	B-Algorithm
in	I-Algorithm
the	I-Algorithm
last	I-Algorithm
place	I-Algorithm
(	O
ULP	B-Algorithm
)	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
there	O
is	O
no	O
representable	O
number	O
lying	O
between	O
the	O
representable	O
numbers	O
1.45a70c22hex	O
and	O
1.45a70c24hex	O
,	O
the	O
ULP	B-Algorithm
is	O
2×16−8	O
,	O
or	O
2−31	O
.	O
</s>
<s>
numbers	O
with	O
an	O
absolute	O
value	O
higher	O
than	O
or	O
equal	O
to	O
1	O
but	O
lower	O
than	O
2	O
,	O
an	O
ULP	B-Algorithm
is	O
exactly	O
2−23	O
or	O
about	O
10−7	O
in	O
single	O
precision	B-Architecture
,	O
and	O
exactly	O
2−53	O
or	O
about	O
10−16	O
in	O
double	O
precision	B-Architecture
.	O
</s>
<s>
The	O
mandated	O
behavior	O
of	O
IEEE-compliant	O
hardware	O
is	O
that	O
the	O
result	O
be	O
within	O
one-half	O
of	O
a	O
ULP	B-Algorithm
.	O
</s>
<s>
Rounding	B-Algorithm
is	O
used	O
when	O
the	O
exact	O
result	O
of	O
a	O
floating-point	B-Algorithm
operation	O
(	O
or	O
a	O
conversion	O
to	O
floating-point	B-Algorithm
format	I-Algorithm
)	O
would	O
need	O
more	O
digits	O
than	O
there	O
are	O
digits	O
in	O
the	O
significand	B-Algorithm
.	O
</s>
<s>
IEEE	O
754	O
requires	O
correct	O
rounding	B-Algorithm
:	O
that	O
is	O
,	O
the	O
rounded	O
result	O
is	O
as	O
if	O
infinitely	O
precise	O
arithmetic	O
was	O
used	O
to	O
compute	O
the	O
value	O
and	O
then	O
rounded	O
(	O
although	O
in	O
implementation	O
only	O
three	O
extra	O
bits	O
are	O
needed	O
to	O
ensure	O
this	O
)	O
.	O
</s>
<s>
There	O
are	O
several	O
different	O
rounding	B-Algorithm
schemes	O
(	O
or	O
rounding	B-Algorithm
modes	O
)	O
.	O
</s>
<s>
Historically	O
,	O
truncation	B-Algorithm
was	O
the	O
typical	O
approach	O
.	O
</s>
<s>
Since	O
the	O
introduction	O
of	O
IEEE	O
754	O
,	O
the	O
default	O
method	O
(	O
round	B-Algorithm
to	I-Algorithm
nearest	I-Algorithm
,	I-Algorithm
ties	I-Algorithm
to	I-Algorithm
even	I-Algorithm
,	O
sometimes	O
called	O
Banker	O
's	O
Rounding	B-Algorithm
)	O
is	O
more	O
commonly	O
used	O
.	O
</s>
<s>
In	O
the	O
case	O
of	O
a	O
tie	O
,	O
the	O
value	O
that	O
would	O
make	O
the	O
significand	B-Algorithm
end	O
in	O
an	O
even	O
digit	O
is	O
chosen	O
.	O
</s>
<s>
The	O
IEEE	O
754	O
standard	O
requires	O
the	O
same	O
rounding	B-Algorithm
to	O
be	O
applied	O
to	O
all	O
fundamental	O
algebraic	O
operations	O
,	O
including	O
square	O
root	O
and	O
conversions	O
,	O
when	O
there	O
is	O
a	O
numeric	B-Algorithm
(	O
non-NaN	O
)	O
result	O
.	O
</s>
<s>
It	O
means	B-Operating_System
that	O
the	O
results	O
of	O
IEEE	O
754	O
operations	O
are	O
completely	O
determined	O
in	O
all	O
bits	O
of	O
the	O
result	O
,	O
except	O
for	O
the	O
representation	O
of	O
NaNs	O
.	O
</s>
<s>
(	O
"	O
Library	B-Library
"	O
functions	O
such	O
as	O
cosine	O
and	O
log	O
are	O
not	O
mandated	O
.	O
)	O
</s>
<s>
Alternative	O
rounding	B-Algorithm
options	O
are	O
also	O
available	O
.	O
</s>
<s>
IEEE	O
754	O
specifies	O
the	O
following	O
rounding	B-Algorithm
modes	O
:	O
</s>
<s>
Applications	O
that	O
require	O
a	O
bounded	O
error	O
are	O
multi-precision	B-Algorithm
floating-point	B-Algorithm
,	O
and	O
interval	B-Algorithm
arithmetic	I-Algorithm
.	O
</s>
<s>
The	O
alternative	O
rounding	B-Algorithm
modes	O
are	O
also	O
useful	O
in	O
diagnosing	O
numerical	B-Algorithm
instability	I-Algorithm
:	O
if	O
the	O
results	O
of	O
a	O
subroutine	O
vary	O
substantially	O
between	O
rounding	B-Algorithm
to	O
+	O
and	O
−	O
infinity	B-Application
then	O
it	O
is	O
likely	O
numerically	B-Algorithm
unstable	I-Algorithm
and	O
affected	O
by	O
round-off	B-Algorithm
error	I-Algorithm
.	O
</s>
<s>
Converting	O
a	O
double-precision	O
binary	B-Algorithm
floating-point	I-Algorithm
number	I-Algorithm
to	O
a	O
decimal	O
string	O
is	O
a	O
common	O
operation	O
,	O
but	O
an	O
algorithm	O
producing	O
results	O
that	O
are	O
both	O
accurate	O
and	O
minimal	O
did	O
not	O
appear	O
in	O
print	O
until	O
1990	O
,	O
with	O
Steele	O
and	O
White	O
's	O
Dragon4	O
.	O
</s>
<s>
David	O
M	O
.	O
Gay	O
's	O
dtoa.c	O
,	O
a	O
practical	O
open-source	O
implementation	O
of	O
many	O
ideas	O
in	O
Dragon4	O
.	O
</s>
<s>
Grisu3	O
,	O
with	O
a	O
4	O
speedup	O
as	O
it	O
removes	O
the	O
use	O
of	O
bignums	B-Algorithm
.	O
</s>
<s>
The	O
problem	O
of	O
parsing	O
a	O
decimal	O
string	O
into	O
a	O
binary	O
FP	O
representation	O
is	O
complex	O
,	O
with	O
an	O
accurate	O
parser	O
not	O
appearing	O
until	O
Clinger	O
's	O
1990	O
work	O
(	O
implemented	O
in	O
dtoa.c	O
)	O
.	O
</s>
<s>
For	O
ease	O
of	O
presentation	O
and	O
understanding	O
,	O
decimal	O
radix	O
with	O
7	B-Device
digit	O
precision	B-Architecture
will	O
be	O
used	O
in	O
the	O
examples	O
,	O
as	O
in	O
the	O
IEEE	O
754	O
decimal32	O
format	O
.	O
</s>
<s>
The	O
fundamental	O
principles	O
are	O
the	O
same	O
in	O
any	O
radix	O
or	O
precision	B-Architecture
,	O
except	O
that	O
normalization	O
is	O
optional	O
(	O
it	O
does	O
not	O
affect	O
the	O
numerical	O
value	O
of	O
the	O
result	O
)	O
.	O
</s>
<s>
Here	O
,	O
s	O
denotes	O
the	O
significand	B-Algorithm
and	O
e	O
denotes	O
the	O
exponent	O
.	O
</s>
<s>
A	O
simple	O
method	O
to	O
add	O
floating-point	B-Algorithm
numbers	I-Algorithm
is	O
to	O
first	O
represent	O
them	O
with	O
the	O
same	O
exponent	O
.	O
</s>
<s>
This	O
is	O
round-off	B-Algorithm
error	I-Algorithm
.	O
</s>
<s>
In	O
the	O
above	O
conceptual	O
examples	O
it	O
would	O
appear	O
that	O
a	O
large	O
number	O
of	O
extra	O
digits	O
would	O
need	O
to	O
be	O
provided	O
by	O
the	O
adder	O
to	O
ensure	O
correct	O
rounding	B-Algorithm
;	O
however	O
,	O
for	O
binary	O
addition	O
or	O
subtraction	O
using	O
careful	O
implementation	O
techniques	O
only	O
a	O
guard	O
bit	O
,	O
a	O
rounding	B-Algorithm
bit	O
and	O
one	O
extra	O
sticky	O
bit	O
need	O
to	O
be	O
carried	O
beyond	O
the	O
precision	B-Architecture
of	O
the	O
operands	O
.	O
</s>
<s>
Another	O
problem	O
of	O
loss	B-Algorithm
of	I-Algorithm
significance	I-Algorithm
occurs	O
when	O
approximations	O
to	O
two	O
nearly	O
equal	O
numbers	O
are	O
subtracted	O
.	O
</s>
<s>
The	O
floating-point	B-Algorithm
difference	O
is	O
computed	O
exactly	O
because	O
the	O
numbers	O
are	O
close	O
—	O
the	O
Sterbenz	B-Algorithm
lemma	I-Algorithm
guarantees	O
this	O
,	O
even	O
in	O
case	O
of	O
underflow	B-Algorithm
when	O
gradual	B-Algorithm
underflow	I-Algorithm
is	O
supported	O
.	O
</s>
<s>
In	O
extreme	O
cases	O
,	O
all	O
significant	B-Architecture
digits	I-Architecture
of	O
precision	B-Architecture
can	O
be	O
lost	O
.	O
</s>
<s>
This	O
cancellation	B-Algorithm
illustrates	O
the	O
danger	O
in	O
assuming	O
that	O
all	O
of	O
the	O
digits	O
of	O
a	O
computed	O
result	O
are	O
meaningful	O
.	O
</s>
<s>
Dealing	O
with	O
the	O
consequences	O
of	O
these	O
errors	O
is	O
a	O
topic	O
in	O
numerical	B-General_Concept
analysis	I-General_Concept
;	O
see	O
also	O
Accuracy	O
problems	O
.	O
</s>
<s>
To	O
multiply	O
,	O
the	O
significands	B-Algorithm
are	O
multiplied	O
while	O
the	O
exponents	O
are	O
added	O
,	O
and	O
the	O
result	O
is	O
rounded	O
and	O
normalized	O
.	O
</s>
<s>
Similarly	O
,	O
division	O
is	O
accomplished	O
by	O
subtracting	O
the	O
divisor	O
's	O
exponent	O
from	O
the	O
dividend	O
's	O
exponent	O
,	O
and	O
dividing	O
the	O
dividend	O
's	O
significand	B-Algorithm
by	O
the	O
divisor	O
's	O
significand	B-Algorithm
.	O
</s>
<s>
There	O
are	O
no	O
cancellation	B-Algorithm
or	O
absorption	O
problems	O
with	O
multiplication	O
or	O
division	O
,	O
though	O
small	O
errors	O
may	O
accumulate	O
as	O
operations	O
are	O
performed	O
in	O
succession	O
.	O
</s>
<s>
In	O
practice	O
,	O
the	O
way	O
these	O
operations	O
are	O
carried	O
out	O
in	O
digital	O
logic	O
can	O
be	O
quite	O
complex	O
(	O
see	O
Booth	O
's	O
multiplication	O
algorithm	O
and	O
Division	B-Algorithm
algorithm	I-Algorithm
)	O
.	O
</s>
<s>
Literals	O
for	O
floating-point	B-Algorithm
numbers	I-Algorithm
depend	O
on	O
languages	O
.	O
</s>
<s>
The	O
C	B-Language
programming	I-Language
language	I-Language
and	O
the	O
IEEE	O
754	O
standard	O
also	O
define	O
a	O
hexadecimal	O
literal	O
syntax	O
with	O
a	O
base-2	O
exponent	O
instead	O
of	O
10	O
.	O
</s>
<s>
In	O
languages	O
like	O
C	B-Language
,	O
when	O
the	O
decimal	O
exponent	O
is	O
omitted	O
,	O
a	O
decimal	O
point	O
is	O
needed	O
to	O
differentiate	O
them	O
from	O
integers	O
.	O
</s>
<s>
Other	O
languages	O
do	O
not	O
have	O
an	O
integer	O
type	O
(	O
such	O
as	O
JavaScript	B-Language
)	O
,	O
or	O
allow	O
overloading	O
of	O
numeric	B-Algorithm
types	O
(	O
such	O
as	O
Haskell	B-Language
)	O
.	O
</s>
<s>
In	O
these	O
cases	O
,	O
digit	O
strings	O
such	O
as	O
123	O
may	O
also	O
be	O
floating-point	B-Algorithm
literals	O
.	O
</s>
<s>
Examples	O
of	O
floating-point	B-Algorithm
literals	O
are	O
:	O
</s>
<s>
Floating-point	B-Algorithm
computation	O
in	O
a	O
computer	O
can	O
run	O
into	O
three	O
kinds	O
of	O
problems	O
:	O
</s>
<s>
An	O
operation	O
can	O
be	O
mathematically	O
undefined	O
,	O
such	O
as	O
∞	O
/	O
∞	O
,	O
or	O
division	B-Algorithm
by	I-Algorithm
zero	I-Algorithm
.	O
</s>
<s>
Such	O
an	O
event	O
is	O
called	O
an	O
overflow	O
(	O
exponent	O
too	O
large	O
)	O
,	O
underflow	B-Algorithm
(	O
exponent	O
too	O
small	O
)	O
or	O
denormalization	B-Algorithm
(	O
precision	B-Architecture
loss	O
)	O
.	O
</s>
<s>
Prior	O
to	O
the	O
IEEE	O
standard	O
,	O
such	O
conditions	O
usually	O
caused	O
the	O
program	O
to	O
terminate	O
,	O
or	O
triggered	O
some	O
kind	O
of	O
trap	B-Application
that	O
the	O
programmer	O
might	O
be	O
able	O
to	O
catch	O
.	O
</s>
<s>
How	O
this	O
worked	O
was	O
system-dependent	O
,	O
meaning	O
that	O
floating-point	B-Algorithm
programs	O
were	O
not	O
portable	O
.	O
</s>
<s>
(	O
The	O
term	O
"	O
exception	B-General_Concept
"	O
as	O
used	O
in	O
IEEE	O
754	O
is	O
a	O
general	O
term	O
meaning	O
an	O
exceptional	O
condition	O
,	O
which	O
is	O
not	O
necessarily	O
an	O
error	O
,	O
and	O
is	O
a	O
different	O
usage	O
to	O
that	O
typically	O
defined	O
in	O
programming	O
languages	O
such	O
as	O
a	O
C++	O
or	O
Java	O
,	O
in	O
which	O
an	O
"	O
exception	B-General_Concept
"	O
is	O
an	O
alternative	O
flow	O
of	O
control	O
,	O
closer	O
to	O
what	O
is	O
termed	O
a	O
"	O
trap	B-Application
"	O
in	O
IEEE	O
754	O
terminology	O
.	O
)	O
</s>
<s>
Here	O
,	O
the	O
required	O
default	O
method	O
of	O
handling	O
exceptions	O
according	O
to	O
IEEE	O
754	O
is	O
discussed	O
(	O
the	O
IEEE	O
754	O
optional	O
trapping	O
and	O
other	O
"	O
alternate	O
exception	B-General_Concept
handling	I-General_Concept
"	O
modes	O
are	O
not	O
discussed	O
)	O
.	O
</s>
<s>
That	O
they	O
are	O
"	O
sticky	O
"	O
means	B-Operating_System
that	O
they	O
are	O
not	O
reset	O
by	O
the	O
next	O
(	O
arithmetic	O
)	O
operation	O
,	O
but	O
stay	O
set	O
until	O
explicitly	O
reset	O
.	O
</s>
<s>
The	O
use	O
of	O
"	O
sticky	O
"	O
flags	O
thus	O
allows	O
for	O
testing	O
of	O
exceptional	O
conditions	O
to	O
be	O
delayed	O
until	O
after	O
a	O
full	O
floating-point	B-Algorithm
expression	O
or	O
subroutine	O
:	O
without	O
them	O
exceptional	O
conditions	O
that	O
could	O
not	O
be	O
otherwise	O
ignored	O
would	O
require	O
explicit	O
testing	O
immediately	O
after	O
every	O
floating-point	B-Algorithm
operation	O
.	O
</s>
<s>
By	O
default	O
,	O
an	O
operation	O
always	O
returns	O
a	O
result	O
according	O
to	O
specification	O
without	O
interrupting	B-Application
computation	O
.	O
</s>
<s>
For	O
instance	O
,	O
1/0	B-Algorithm
returns	O
+∞	O
,	O
while	O
also	O
setting	O
the	O
divide-by-zero	B-Algorithm
flag	O
bit	O
(	O
this	O
default	O
of	O
∞	O
is	O
designed	O
to	O
often	O
return	O
a	O
finite	O
result	O
when	O
used	O
in	O
subsequent	O
operations	O
and	O
so	O
be	O
safely	O
ignored	O
)	O
.	O
</s>
<s>
The	O
original	O
IEEE	O
754	O
standard	O
,	O
however	O
,	O
failed	O
to	O
recommend	O
operations	O
to	O
handle	O
such	O
sets	O
of	O
arithmetic	O
exception	B-General_Concept
flag	O
bits	O
.	O
</s>
<s>
So	O
while	O
these	O
were	O
implemented	O
in	O
hardware	O
,	O
initially	O
programming	O
language	O
implementations	O
typically	O
did	O
not	O
provide	O
a	O
means	B-Operating_System
to	O
access	O
them	O
(	O
apart	O
from	O
assembler	O
)	O
.	O
</s>
<s>
Over	O
time	O
some	O
programming	O
language	O
standards	O
(	O
e.g.	O
,	O
C99/C11	O
and	O
Fortran	B-Application
)	O
have	O
been	O
updated	O
to	O
specify	O
methods	O
to	O
access	O
and	O
change	O
status	O
flag	O
bits	O
.	O
</s>
<s>
The	O
programming	O
model	O
is	O
based	O
on	O
a	O
single	O
thread	O
of	O
execution	O
and	O
use	O
of	O
them	O
by	O
multiple	O
threads	O
has	O
to	O
be	O
handled	O
by	O
a	O
means	B-Operating_System
outside	O
of	O
the	O
standard	O
(	O
e.g.	O
</s>
<s>
underflow	B-Algorithm
,	O
set	O
if	O
the	O
rounded	O
value	O
is	O
tiny	O
(	O
as	O
specified	O
in	O
IEEE	O
754	O
)	O
and	O
inexact	O
(	O
or	O
maybe	O
limited	O
to	O
if	O
it	O
has	O
denormalization	B-Algorithm
loss	O
,	O
as	O
per	O
the	O
1985	O
version	O
of	O
IEEE	O
754	O
)	O
,	O
returning	O
a	O
subnormal	O
value	O
including	O
the	O
zeros	O
.	O
</s>
<s>
An	O
infinity	B-Application
or	O
maximal	O
finite	O
value	O
is	O
returned	O
,	O
depending	O
on	O
which	O
rounding	B-Algorithm
is	O
used	O
.	O
</s>
<s>
divide-by-zero	B-Algorithm
,	O
set	O
if	O
the	O
result	O
is	O
infinite	O
given	O
finite	O
operands	O
,	O
returning	O
an	O
infinity	B-Application
,	O
either	O
+∞	O
or	O
−∞	O
.	O
</s>
<s>
sqrt( −1	O
)	O
or	O
0/0	O
,	O
returning	O
a	O
quiet	O
NaN	O
.	O
</s>
<s>
inexact	O
returns	O
a	O
correctly	O
rounded	O
result	O
,	O
and	O
underflow	B-Algorithm
returns	O
a	O
value	O
less	O
than	O
or	O
equal	O
to	O
the	O
smallest	O
positive	O
normal	O
number	O
in	O
magnitude	O
and	O
can	O
almost	O
always	O
be	O
ignored	O
.	O
</s>
<s>
divide-by-zero	B-Algorithm
returns	O
infinity	B-Application
exactly	O
,	O
which	O
will	O
typically	O
then	O
divide	O
a	O
finite	O
number	O
and	O
so	O
give	O
zero	O
,	O
or	O
else	O
will	O
give	O
an	O
invalid	O
exception	B-General_Concept
subsequently	O
if	O
not	O
,	O
and	O
so	O
can	O
also	O
typically	O
be	O
ignored	O
.	O
</s>
<s>
If	O
a	O
short-circuit	O
develops	O
with	O
set	O
to	O
0	O
,	O
will	O
return	O
+infinity	O
which	O
will	O
give	O
a	O
final	O
of	O
0	O
,	O
as	O
expected	O
(	O
see	O
the	O
continued	O
fraction	O
example	O
of	O
IEEE	O
754	O
design	O
rationale	O
for	O
another	O
example	O
)	O
.	O
</s>
<s>
Overflow	O
and	O
invalid	O
exceptions	O
can	O
typically	O
not	O
be	O
ignored	O
,	O
but	O
do	O
not	O
necessarily	O
represent	O
errors	O
:	O
for	O
example	O
,	O
a	O
root-finding	O
routine	O
,	O
as	O
part	O
of	O
its	O
normal	O
operation	O
,	O
may	O
evaluate	O
a	O
passed-in	O
function	O
at	O
values	O
outside	O
of	O
its	O
domain	O
,	O
returning	O
NaN	O
and	O
an	O
invalid	O
exception	B-General_Concept
flag	O
to	O
be	O
ignored	O
until	O
finding	O
a	O
useful	O
start	O
point	O
.	O
</s>
<s>
The	O
fact	O
that	O
floating-point	B-Algorithm
numbers	I-Algorithm
cannot	O
precisely	O
represent	O
all	O
real	O
numbers	O
,	O
and	O
that	O
floating-point	B-Algorithm
operations	O
cannot	O
precisely	O
represent	O
true	O
arithmetic	O
operations	O
,	O
leads	O
to	O
many	O
surprising	O
situations	O
.	O
</s>
<s>
This	O
is	O
related	O
to	O
the	O
finite	O
precision	B-Architecture
with	O
which	O
computers	O
generally	O
represent	O
numbers	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
non-representability	O
of	O
0.1	O
and	O
0.01	O
(	O
in	O
binary	O
)	O
means	B-Operating_System
that	O
the	O
result	O
of	O
attempting	O
to	O
square	O
0.1	O
is	O
neither	O
0.01	O
nor	O
the	O
representable	O
number	O
closest	O
to	O
it	O
.	O
</s>
<s>
Also	O
,	O
the	O
non-representability	O
of	O
π	O
(	O
and	O
π/2	O
)	O
means	B-Operating_System
that	O
an	O
attempted	O
computation	O
of	O
tan	O
(π/	O
2	O
)	O
will	O
not	O
yield	O
a	O
result	O
of	O
infinity	B-Application
,	O
nor	O
will	O
it	O
even	O
overflow	O
in	O
the	O
usual	O
floating-point	B-Algorithm
formats	I-Algorithm
(	O
assuming	O
an	O
accurate	O
implementation	O
of	O
tan	O
)	O
.	O
</s>
<s>
It	O
is	O
simply	O
not	O
possible	O
for	O
standard	O
floating-point	B-Algorithm
hardware	O
to	O
attempt	O
to	O
compute	O
tan	O
(π/	O
2	O
)	O
,	O
because	O
π/2	O
cannot	O
be	O
represented	O
exactly	O
.	O
</s>
<s>
This	O
computation	O
in	O
C	B-Language
:	O
</s>
<s>
In	O
single	O
precision	B-Architecture
(	O
using	O
the	O
tanf	O
function	O
)	O
,	O
the	O
result	O
will	O
be	O
−	O
22877332.0	O
.	O
</s>
<s>
The	O
result	O
will	O
be	O
(	O
approximately	O
)	O
0.1225	O
in	O
double	O
precision	B-Architecture
,	O
or	O
−	O
0.8742	O
in	O
single	O
precision	B-Architecture
.	O
</s>
<s>
While	O
floating-point	B-Algorithm
addition	O
and	O
multiplication	O
are	O
both	O
commutative	O
(	O
and	O
)	O
,	O
they	O
are	O
not	O
necessarily	O
associative	O
.	O
</s>
<s>
Using	O
7-digit	O
significand	B-Algorithm
decimal	O
arithmetic	O
:	O
</s>
<s>
(	O
a	O
+	O
b	O
)	O
+	O
c	B-Language
:	O
</s>
<s>
a	O
+	O
(	O
b	O
+	O
c	B-Language
)	O
:	O
</s>
<s>
In	O
addition	O
to	O
loss	B-Algorithm
of	I-Algorithm
significance	I-Algorithm
,	O
inability	O
to	O
represent	O
numbers	O
such	O
as	O
π	O
and	O
0.1	O
exactly	O
,	O
and	O
other	O
slight	O
inaccuracies	O
,	O
the	O
following	O
phenomena	O
may	O
occur	O
:	O
</s>
<s>
On	O
25	O
February	O
1991	O
,	O
a	O
loss	B-Algorithm
of	I-Algorithm
significance	I-Algorithm
in	O
a	O
MIM-104	O
Patriot	O
missile	O
battery	O
prevented	O
it	O
from	O
intercepting	O
an	O
incoming	O
Scud	O
missile	O
in	O
Dhahran	O
,	O
Saudi	O
Arabia	O
,	O
contributing	O
to	O
the	O
death	O
of	O
28	O
soldiers	O
from	O
the	O
U.S.	O
Army	O
's	O
14th	O
Quartermaster	O
Detachment	O
.	O
</s>
<s>
Machine	B-Algorithm
precision	I-Algorithm
is	O
a	O
quantity	O
that	O
characterizes	O
the	O
accuracy	O
of	O
a	O
floating-point	B-Algorithm
system	O
,	O
and	O
is	O
used	O
in	O
backward	O
error	O
analysis	O
of	O
floating-point	B-Algorithm
algorithms	O
.	O
</s>
<s>
It	O
is	O
also	O
known	O
as	O
unit	O
roundoff	O
or	O
machine	B-Algorithm
epsilon	I-Algorithm
.	O
</s>
<s>
Usually	O
denoted	O
,	O
its	O
value	O
depends	O
on	O
the	O
particular	O
rounding	B-Algorithm
being	O
used	O
.	O
</s>
<s>
With	O
rounding	B-Algorithm
to	O
zero	O
,	O
</s>
<s>
whereas	O
rounding	B-Algorithm
to	O
nearest	O
,	O
</s>
<s>
where	O
B	O
is	O
the	O
base	O
of	O
the	O
system	O
and	O
P	O
is	O
the	O
precision	B-Architecture
of	O
the	O
significand	B-Algorithm
(	O
in	O
base	O
B	O
)	O
.	O
</s>
<s>
This	O
is	O
important	O
since	O
it	O
bounds	O
the	O
relative	B-Algorithm
error	I-Algorithm
in	O
representing	O
any	O
non-zero	O
real	O
number	O
within	O
the	O
normalized	O
range	O
of	O
a	O
floating-point	B-Algorithm
system	O
:	O
</s>
<s>
Backward	O
error	O
analysis	O
,	O
the	O
theory	O
of	O
which	O
was	O
developed	O
and	O
popularized	O
by	O
James	O
H	O
.	O
Wilkinson	O
,	O
can	O
be	O
used	O
to	O
establish	O
that	O
an	O
algorithm	O
implementing	O
a	O
numerical	O
function	O
is	O
numerically	B-Algorithm
stable	I-Algorithm
.	O
</s>
<s>
The	O
basic	O
approach	O
is	O
to	O
show	O
that	O
although	O
the	O
calculated	O
result	O
,	O
due	O
to	O
roundoff	B-Algorithm
errors	I-Algorithm
,	O
will	O
not	O
be	O
exactly	O
correct	O
,	O
it	O
is	O
the	O
exact	O
solution	O
to	O
a	O
nearby	O
problem	O
with	O
slightly	O
perturbed	O
input	O
data	O
.	O
</s>
<s>
Stability	O
is	O
a	O
measure	O
of	O
the	O
sensitivity	O
to	O
rounding	B-Algorithm
errors	I-Algorithm
of	O
a	O
given	O
numerical	O
procedure	O
;	O
by	O
contrast	O
,	O
the	O
condition	B-Algorithm
number	I-Algorithm
of	O
a	O
function	O
for	O
a	O
given	O
problem	O
indicates	O
the	O
inherent	O
sensitivity	O
of	O
the	O
function	O
to	O
small	O
perturbations	O
in	O
its	O
input	O
and	O
is	O
independent	O
of	O
the	O
implementation	O
used	O
to	O
solve	O
the	O
problem	O
.	O
</s>
<s>
Although	O
individual	O
arithmetic	O
operations	O
of	O
IEEE	O
754	O
are	O
guaranteed	O
accurate	O
to	O
within	O
half	O
a	O
ULP	B-Algorithm
,	O
more	O
complicated	O
formulae	O
can	O
suffer	O
from	O
larger	O
errors	O
for	O
a	O
variety	O
of	O
reasons	O
.	O
</s>
<s>
The	O
loss	O
of	O
accuracy	O
can	O
be	O
substantial	O
if	O
a	O
problem	O
or	O
its	O
data	O
are	O
ill-conditioned	B-Algorithm
,	O
meaning	O
that	O
the	O
correct	O
result	O
is	O
hypersensitive	O
to	O
tiny	O
perturbations	O
in	O
its	O
data	O
.	O
</s>
<s>
However	O
,	O
even	O
functions	O
that	O
are	O
well-conditioned	B-Algorithm
can	O
suffer	O
from	O
large	O
loss	O
of	O
accuracy	O
if	O
an	O
algorithm	O
numerically	B-Algorithm
unstable	I-Algorithm
for	O
that	O
data	O
is	O
used	O
:	O
apparently	O
equivalent	O
formulations	O
of	O
expressions	O
in	O
a	O
programming	O
language	O
can	O
differ	O
markedly	O
in	O
their	O
numerical	B-Algorithm
stability	I-Algorithm
.	O
</s>
<s>
One	O
approach	O
to	O
remove	O
the	O
risk	O
of	O
such	O
loss	O
of	O
accuracy	O
is	O
the	O
design	O
and	O
analysis	O
of	O
numerically	B-Algorithm
stable	I-Algorithm
algorithms	O
,	O
which	O
is	O
an	O
aim	O
of	O
the	O
branch	O
of	O
mathematics	O
known	O
as	O
numerical	B-General_Concept
analysis	I-General_Concept
.	O
</s>
<s>
Another	O
approach	O
that	O
can	O
protect	O
against	O
the	O
risk	O
of	O
numerical	B-Algorithm
instabilities	I-Algorithm
is	O
the	O
computation	O
of	O
intermediate	O
(	O
scratch	O
)	O
values	O
in	O
an	O
algorithm	O
at	O
a	O
higher	O
precision	B-Architecture
than	O
the	O
final	O
result	O
requires	O
,	O
which	O
can	O
remove	O
,	O
or	O
reduce	O
by	O
orders	O
of	O
magnitude	O
,	O
such	O
risk	O
:	O
IEEE	O
754	O
quadruple	O
precision	B-Architecture
and	O
extended	B-Algorithm
precision	I-Algorithm
are	O
designed	O
for	O
this	O
purpose	O
when	O
computing	O
at	O
double	O
precision	B-Architecture
.	O
</s>
<s>
For	O
example	O
,	O
the	O
following	O
algorithm	O
is	O
a	O
direct	O
implementation	O
to	O
compute	O
the	O
function	O
which	O
is	O
well-conditioned	B-Algorithm
at	O
1.0	O
,	O
however	O
it	O
can	O
be	O
shown	O
to	O
be	O
numerically	B-Algorithm
unstable	I-Algorithm
and	O
lose	O
up	O
to	O
half	O
the	O
significant	B-Architecture
digits	I-Architecture
carried	O
by	O
the	O
arithmetic	O
when	O
computed	O
near	O
1.0	O
.	O
</s>
<s>
If	O
,	O
however	O
,	O
intermediate	O
computations	O
are	O
all	O
performed	O
in	O
extended	B-Algorithm
precision	I-Algorithm
(	O
e.g.	O
</s>
<s>
by	O
setting	O
line	O
 [ 1 ] 	O
to	O
C99	B-Language
)	O
,	O
then	O
up	O
to	O
full	O
precision	B-Architecture
in	O
the	O
final	O
double	O
result	O
can	O
be	O
maintained	O
.	O
</s>
<s>
Alternatively	O
,	O
a	O
numerical	B-General_Concept
analysis	I-General_Concept
of	O
the	O
algorithm	O
reveals	O
that	O
if	O
the	O
following	O
non-obvious	O
change	O
to	O
line	O
 [ 2 ] 	O
is	O
made	O
:	O
</s>
<s>
then	O
the	O
algorithm	O
becomes	O
numerically	B-Algorithm
stable	I-Algorithm
and	O
can	O
compute	O
to	O
full	O
double	O
precision	B-Architecture
.	O
</s>
<s>
To	O
maintain	O
the	O
properties	O
of	O
such	O
carefully	O
constructed	O
numerically	B-Algorithm
stable	I-Algorithm
programs	O
,	O
careful	O
handling	O
by	O
the	O
compiler	B-Language
is	O
required	O
.	O
</s>
<s>
Certain	O
"	O
optimizations	O
"	O
that	O
compilers	B-Language
might	O
make	O
(	O
for	O
example	O
,	O
reordering	O
operations	O
)	O
can	O
work	O
against	O
the	O
goals	O
of	O
well-behaved	O
software	O
.	O
</s>
<s>
There	O
is	O
some	O
controversy	O
about	O
the	O
failings	O
of	O
compilers	B-Language
and	O
language	O
designs	O
in	O
this	O
area	O
:	O
C99	B-Language
is	O
an	O
example	O
of	O
a	O
language	O
where	O
such	O
optimizations	O
are	O
carefully	O
specified	O
to	O
maintain	O
numerical	O
precision	B-Architecture
.	O
</s>
<s>
A	O
detailed	O
treatment	O
of	O
the	O
techniques	O
for	O
writing	O
high-quality	O
floating-point	B-Algorithm
software	O
is	O
beyond	O
the	O
scope	O
of	O
this	O
article	O
,	O
and	O
the	O
reader	O
is	O
referred	O
to	O
,	O
and	O
the	O
other	O
references	O
at	O
the	O
bottom	O
of	O
this	O
article	O
.	O
</s>
<s>
Kahan	O
suggests	O
several	O
rules	O
of	O
thumb	O
that	O
can	O
substantially	O
decrease	O
by	O
orders	O
of	O
magnitude	O
the	O
risk	O
of	O
numerical	O
anomalies	O
,	O
in	O
addition	O
to	O
,	O
or	O
in	O
lieu	O
of	O
,	O
a	O
more	O
careful	O
numerical	B-General_Concept
analysis	I-General_Concept
.	O
</s>
<s>
These	O
include	O
:	O
as	O
noted	O
above	O
,	O
computing	O
all	O
expressions	O
and	O
intermediate	O
results	O
in	O
the	O
highest	O
precision	B-Architecture
supported	O
in	O
hardware	O
(	O
a	O
common	O
rule	O
of	O
thumb	O
is	O
to	O
carry	O
twice	O
the	O
precision	B-Architecture
of	O
the	O
desired	O
result	O
,	O
i.e.	O
</s>
<s>
compute	O
in	O
double	O
precision	B-Architecture
for	O
a	O
final	O
single-precision	O
result	O
,	O
or	O
in	O
double	B-Algorithm
extended	I-Algorithm
or	O
quad	O
precision	B-Architecture
for	O
up	O
to	O
double-precision	O
results	O
)	O
;	O
and	O
rounding	B-Algorithm
input	O
data	O
and	O
results	O
to	O
only	O
the	O
precision	B-Architecture
required	O
and	O
supported	O
by	O
the	O
input	O
data	O
(	O
carrying	O
excess	O
precision	B-Architecture
in	O
the	O
final	O
result	O
beyond	O
that	O
required	O
and	O
supported	O
by	O
the	O
input	O
data	O
can	O
be	O
misleading	O
,	O
increases	O
storage	O
cost	O
and	O
decreases	O
speed	O
,	O
and	O
the	O
excess	O
bits	O
can	O
affect	O
convergence	O
of	O
numerical	O
procedures	O
:	O
notably	O
,	O
the	O
first	O
form	O
of	O
the	O
iterative	O
example	O
given	O
below	O
converges	O
correctly	O
when	O
using	O
this	O
rule	O
of	O
thumb	O
)	O
.	O
</s>
<s>
As	O
decimal	O
fractions	O
can	O
often	O
not	O
be	O
exactly	O
represented	O
in	O
binary	B-Algorithm
floating-point	I-Algorithm
,	O
such	O
arithmetic	O
is	O
at	O
its	O
best	O
when	O
it	O
is	O
simply	O
being	O
used	O
to	O
measure	O
real-world	O
quantities	O
over	O
a	O
wide	O
range	O
of	O
scales	O
(	O
such	O
as	O
the	O
orbital	O
period	O
of	O
a	O
moon	O
around	O
Saturn	O
or	O
the	O
mass	O
of	O
a	O
proton	B-Application
)	O
,	O
and	O
at	O
its	O
worst	O
when	O
it	O
is	O
expected	O
to	O
model	O
the	O
interactions	O
of	O
quantities	O
expressed	O
as	O
decimal	O
strings	O
that	O
are	O
expected	O
to	O
be	O
exact	O
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
financial	O
software	O
tends	O
not	O
to	O
use	O
a	O
binary	B-Algorithm
floating-point	I-Algorithm
number	I-Algorithm
representation	O
.	O
</s>
<s>
The	O
"	O
decimal	O
"	O
data	O
type	O
of	O
the	O
C#	B-Application
and	O
Python	B-Language
programming	I-Language
languages	I-Language
,	O
and	O
the	O
decimal	O
formats	O
of	O
the	O
IEEE	O
754-2008	O
standard	O
,	O
are	O
designed	O
to	O
avoid	O
the	O
problems	O
of	O
binary	B-Algorithm
floating-point	I-Algorithm
representations	O
when	O
applied	O
to	O
human-entered	O
exact	O
decimal	O
values	O
,	O
and	O
make	O
the	O
arithmetic	O
always	O
behave	O
as	O
expected	O
when	O
numbers	O
are	O
printed	O
in	O
decimal	O
.	O
</s>
<s>
Expectations	O
from	O
mathematics	O
may	O
not	O
be	O
realized	O
in	O
the	O
field	O
of	O
floating-point	B-Algorithm
computation	O
.	O
</s>
<s>
For	O
example	O
,	O
it	O
is	O
known	O
that	O
,	O
and	O
that	O
,	O
however	O
these	O
facts	O
cannot	O
be	O
relied	O
on	O
when	O
the	O
quantities	O
involved	O
are	O
the	O
result	O
of	O
floating-point	B-Algorithm
computation	O
.	O
</s>
<s>
The	O
use	O
of	O
the	O
equality	O
test	O
(	O
if	O
(	O
x	O
==	O
y	O
)	O
...	O
)	O
requires	O
care	O
when	O
dealing	O
with	O
floating-point	B-Algorithm
numbers	I-Algorithm
.	O
</s>
<s>
Even	O
simple	O
expressions	O
like	O
0.6/0.2	O
-3	O
==	O
0	O
will	O
,	O
on	O
most	O
computers	O
,	O
fail	O
to	O
be	O
true	O
(	O
in	O
IEEE	O
754	O
double	O
precision	B-Architecture
,	O
for	O
example	O
,	O
0.6/0.2	O
-	O
3	O
is	O
approximately	O
equal	O
to	O
-4.44089209850063e-16	O
)	O
.	O
</s>
<s>
The	O
wisdom	O
of	O
doing	O
this	O
varies	O
greatly	O
,	O
and	O
can	O
require	O
numerical	B-General_Concept
analysis	I-General_Concept
to	O
bound	O
epsilon	O
.	O
</s>
<s>
Values	O
derived	O
from	O
the	O
primary	O
data	O
representation	O
and	O
their	O
comparisons	O
should	O
be	O
performed	O
in	O
a	O
wider	O
,	O
extended	O
,	O
precision	B-Architecture
to	O
minimize	O
the	O
risk	O
of	O
such	O
inconsistencies	O
due	O
to	O
round-off	B-Algorithm
errors	I-Algorithm
.	O
</s>
<s>
For	O
example	O
,	O
in	O
computational	O
geometry	O
,	O
exact	O
tests	O
of	O
whether	O
a	O
point	O
lies	O
off	O
or	O
on	O
a	O
line	O
or	O
plane	O
defined	O
by	O
other	O
points	O
can	O
be	O
performed	O
using	O
adaptive	O
precision	B-Architecture
or	O
exact	O
arithmetic	O
methods	O
.	O
</s>
<s>
Small	O
errors	O
in	O
floating-point	B-Algorithm
arithmetic	I-Algorithm
can	O
grow	O
when	O
mathematical	O
algorithms	O
perform	O
operations	O
an	O
enormous	O
number	O
of	O
times	O
.	O
</s>
<s>
Summation	O
of	O
a	O
vector	O
of	O
floating-point	B-Algorithm
values	O
is	O
a	O
basic	O
algorithm	O
in	O
scientific	O
computing	O
,	O
and	O
so	O
an	O
awareness	O
of	O
when	O
loss	B-Algorithm
of	I-Algorithm
significance	I-Algorithm
can	O
occur	O
is	O
essential	O
.	O
</s>
<s>
This	O
can	O
lead	O
to	O
loss	B-Algorithm
of	I-Algorithm
significance	I-Algorithm
.	O
</s>
<s>
The	O
Kahan	B-Algorithm
summation	I-Algorithm
algorithm	I-Algorithm
may	O
be	O
used	O
to	O
reduce	O
the	O
errors	O
.	O
</s>
<s>
Round-off	B-Algorithm
error	I-Algorithm
can	O
affect	O
the	O
convergence	O
and	O
accuracy	O
of	O
iterative	O
numerical	O
procedures	O
.	O
</s>
<s>
As	O
an	O
example	O
,	O
Archimedes	B-Device
approximated	O
π	O
by	O
calculating	O
the	O
perimeters	O
of	O
polygons	O
inscribing	O
and	O
circumscribing	O
a	O
circle	O
,	O
starting	O
with	O
hexagons	O
,	O
and	O
successively	O
doubling	O
the	O
number	O
of	O
sides	O
.	O
</s>
<s>
As	O
noted	O
above	O
,	O
computations	O
may	O
be	O
rearranged	O
in	O
a	O
way	O
that	O
is	O
mathematically	O
equivalent	O
but	O
less	O
prone	O
to	O
error	O
(	O
numerical	B-General_Concept
analysis	I-General_Concept
)	O
.	O
</s>
<s>
Here	O
is	O
a	O
computation	O
using	O
IEEE	O
"	O
double	O
"	O
(	O
a	O
significand	B-Algorithm
with	O
53	O
bits	O
of	O
precision	B-Architecture
)	O
arithmetic	O
:	O
</s>
<s>
While	O
the	O
two	O
forms	O
of	O
the	O
recurrence	O
formula	O
are	O
clearly	O
mathematically	O
equivalent	O
,	O
the	O
first	O
subtracts	O
1	O
from	O
a	O
number	O
extremely	O
close	O
to	O
1	O
,	O
leading	O
to	O
an	O
increasingly	O
problematic	O
loss	O
of	O
significant	B-Architecture
digits	I-Architecture
.	O
</s>
<s>
It	O
never	O
gets	O
better	O
than	O
about	O
8	O
digits	O
,	O
even	O
though	O
53-bit	O
arithmetic	O
should	O
be	O
capable	O
of	O
about	O
16	O
digits	O
of	O
precision	B-Architecture
.	O
</s>
<s>
When	O
the	O
second	O
form	O
of	O
the	O
recurrence	O
is	O
used	O
,	O
the	O
value	O
converges	O
to	O
15	O
digits	O
of	O
precision	B-Architecture
.	O
</s>
<s>
The	O
aforementioned	O
lack	O
of	O
associativity	O
of	O
floating-point	B-Algorithm
operations	O
in	O
general	O
means	B-Operating_System
that	O
compilers	B-Language
cannot	O
as	O
effectively	O
reorder	O
arithmetic	O
expressions	O
as	O
they	O
could	O
with	O
integer	O
and	O
fixed-point	O
arithmetic	O
,	O
presenting	O
a	O
roadblock	O
in	O
optimizations	O
such	O
as	O
common	O
subexpression	O
elimination	O
and	O
auto-vectorization	O
.	O
</s>
<s>
The	O
"	O
fast	O
math	O
"	O
option	O
on	O
many	O
compilers	B-Language
(	O
ICC	O
,	O
GCC	O
,	O
Clang	O
,	O
MSVC	O
...	O
)	O
turns	O
on	O
reassociation	O
along	O
with	O
unsafe	O
assumptions	O
such	O
as	O
a	O
lack	O
of	O
NaN	O
and	O
infinite	O
numbers	O
in	O
IEEE	O
754	O
.	O
</s>
<s>
Some	O
compilers	B-Language
also	O
offer	O
more	O
granular	O
options	O
to	O
only	O
turn	O
on	O
reassociation	O
.	O
</s>
<s>
In	O
either	O
case	O
,	O
the	O
programmer	O
is	O
exposed	O
to	O
many	O
of	O
the	O
precision	B-Architecture
pitfalls	O
mentioned	O
above	O
for	O
the	O
portion	O
of	O
the	O
program	O
using	O
"	O
fast	O
"	O
math	O
.	O
</s>
<s>
In	O
some	O
compilers	B-Language
(	O
GCC	O
and	O
Clang	O
)	O
,	O
turning	O
on	O
"	O
fast	O
"	O
math	O
may	O
cause	O
the	O
program	O
to	O
disable	O
subnormal	O
floats	B-Algorithm
at	O
startup	O
,	O
affecting	O
the	O
floating-point	B-Algorithm
behavior	O
of	O
not	O
only	O
the	O
generated	O
code	O
,	O
but	O
also	O
any	O
program	O
using	O
such	O
code	O
as	O
a	O
library	B-Library
.	O
</s>
<s>
In	O
most	O
Fortran	B-Application
compilers	B-Language
,	O
as	O
allowed	O
by	O
the	O
ISO/IEC	O
1539-1:2004	O
Fortran	B-Application
standard	O
,	O
reassociation	O
is	O
the	O
default	O
,	O
with	O
breakage	O
largely	O
prevented	O
by	O
the	O
"	O
protect	O
parens	O
"	O
setting	O
(	O
also	O
on	O
by	O
default	O
)	O
.	O
</s>
<s>
This	O
setting	O
stops	O
the	O
compiler	B-Language
from	O
reassociating	O
beyond	O
the	O
boundaries	O
of	O
parentheses	O
.	O
</s>
<s>
Intel	B-Language
Fortran	I-Language
Compiler	I-Language
is	O
a	O
notable	O
outlier	O
.	O
</s>
<s>
One	O
attempt	O
at	O
formalizing	O
"	O
fast	O
"	O
math	O
optimizations	O
is	O
seen	O
in	O
Icing	O
,	O
a	O
verified	O
compiler	B-Language
.	O
</s>
