<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
an	O
integer	O
overflow	O
occurs	O
when	O
an	O
arithmetic	O
operation	O
attempts	O
to	O
create	O
a	O
numeric	O
value	O
that	O
is	O
outside	O
of	O
the	O
range	O
that	O
can	O
be	O
represented	O
with	O
a	O
given	O
number	O
of	O
digits	O
–	O
either	O
higher	O
than	O
the	O
maximum	O
or	O
lower	O
than	O
the	O
minimum	O
representable	O
value	O
.	O
</s>
<s>
On	O
some	O
processors	O
like	O
graphics	B-Architecture
processing	I-Architecture
units	I-Architecture
(	O
GPUs	B-Architecture
)	O
and	O
digital	B-Architecture
signal	I-Architecture
processors	I-Architecture
(	O
DSPs	O
)	O
which	O
support	O
saturation	B-Algorithm
arithmetic	I-Algorithm
,	O
overflowed	O
results	O
would	O
be	O
"	O
clamped	O
"	O
,	O
i.e.	O
</s>
<s>
The	O
register	B-General_Concept
width	I-General_Concept
of	O
a	O
processor	O
determines	O
the	O
range	O
of	O
values	O
that	O
can	O
be	O
represented	O
in	O
its	O
registers	O
.	O
</s>
<s>
Though	O
the	O
vast	O
majority	O
of	O
computers	O
can	O
perform	O
multiple-precision	O
arithmetic	O
on	O
operands	O
in	O
memory	O
,	O
allowing	O
numbers	O
to	O
be	O
arbitrarily	O
long	O
and	O
overflow	O
to	O
be	O
avoided	O
,	O
the	O
register	B-General_Concept
width	I-General_Concept
limits	O
the	O
sizes	O
of	O
numbers	O
that	O
can	O
be	O
operated	O
on	O
(	O
e.g.	O
,	O
added	O
or	O
subtracted	O
)	O
using	O
a	O
single	O
instruction	O
per	O
operation	O
.	O
</s>
<s>
Typical	O
binary	O
register	B-General_Concept
widths	I-General_Concept
for	O
unsigned	O
integers	O
include	O
:	O
</s>
<s>
64-bit	B-Device
:	O
maximum	O
representable	O
value	O
264	O
−	O
1	O
=	O
18,446,744,073,709,551,615	O
(	O
the	O
most	O
common	O
width	O
for	O
personal	O
computer	O
central	B-General_Concept
processing	I-General_Concept
units	I-General_Concept
(	O
CPUs	B-General_Concept
)	O
,	O
)	O
,	O
</s>
<s>
In	O
particular	O
,	O
multiplying	O
or	O
adding	O
two	O
integers	O
may	O
result	O
in	O
a	O
value	O
that	O
is	O
unexpectedly	O
small	O
,	O
and	O
subtracting	O
from	O
a	O
small	O
integer	O
may	O
cause	O
a	O
wrap	O
to	O
a	O
large	O
positive	O
value	O
(	O
for	O
example	O
,	O
8-bit	O
integer	O
addition	O
255	O
+	O
2	O
results	O
in	O
1	O
,	O
which	O
is	O
,	O
and	O
similarly	O
subtraction	O
0	O
−	O
1	O
results	O
in	O
255	O
,	O
a	O
two	B-General_Concept
's	I-General_Concept
complement	I-General_Concept
representation	O
of	O
−1	O
)	O
.	O
</s>
<s>
Such	O
wraparound	O
may	O
cause	O
security	O
detrimentsif	O
an	O
overflowed	O
value	O
is	O
used	O
as	O
the	O
number	O
of	O
bytes	O
to	O
allocate	O
for	O
a	O
buffer	O
,	O
the	O
buffer	O
will	O
be	O
allocated	O
unexpectedly	O
small	O
,	O
potentially	O
leading	O
to	O
a	O
buffer	B-General_Concept
overflow	I-General_Concept
which	O
,	O
depending	O
on	O
the	O
use	O
of	O
the	O
buffer	O
,	O
might	O
in	O
turn	O
cause	O
arbitrary	O
code	O
execution	O
.	O
</s>
<s>
If	O
the	O
variable	O
has	O
a	O
signed	B-Algorithm
integer	I-Algorithm
type	O
,	O
a	O
program	O
may	O
make	O
the	O
assumption	O
that	O
a	O
variable	O
always	O
contains	O
a	O
positive	O
value	O
.	O
</s>
<s>
An	O
integer	O
overflow	O
can	O
cause	O
the	O
value	O
to	O
wrap	O
and	O
become	O
negative	O
,	O
which	O
violates	O
the	O
program	O
's	O
assumption	O
and	O
may	O
lead	O
to	O
unexpected	O
behavior	O
(	O
for	O
example	O
,	O
8-bit	O
integer	O
addition	O
of	O
127	O
+	O
1	O
results	O
in	O
−128	O
,	O
a	O
two	B-General_Concept
's	I-General_Concept
complement	I-General_Concept
of	O
128	O
)	O
.	O
</s>
<s>
The	O
carry	B-Algorithm
flag	I-Algorithm
is	O
set	O
when	O
the	O
result	O
of	O
an	O
addition	O
or	O
subtraction	O
,	O
considering	O
the	O
operands	O
and	O
result	O
as	O
unsigned	O
numbers	O
,	O
does	O
not	O
fit	O
in	O
the	O
given	O
number	O
of	O
bits	O
.	O
</s>
<s>
The	O
overflow	B-Algorithm
flag	I-Algorithm
is	O
set	O
when	O
the	O
result	O
of	O
an	O
operation	O
on	O
signed	B-Algorithm
numbers	O
does	O
not	O
have	O
the	O
sign	O
that	O
one	O
would	O
predict	O
from	O
the	O
signs	O
of	O
the	O
operands	O
,	O
e.g.	O
,	O
a	O
negative	O
result	O
when	O
adding	O
two	O
positive	O
numbers	O
.	O
</s>
<s>
This	O
indicates	O
that	O
an	O
overflow	O
has	O
occurred	O
and	O
the	O
signed	B-Algorithm
result	O
represented	O
in	O
two	B-General_Concept
's	I-General_Concept
complement	I-General_Concept
form	O
would	O
not	O
fit	O
in	O
the	O
given	O
number	O
of	O
bits	O
.	O
</s>
<s>
The	O
term	O
underflow	B-Algorithm
is	O
most	O
commonly	O
used	O
for	O
floating-point	O
math	O
and	O
not	O
for	O
integer	O
math	O
.	O
</s>
<s>
However	O
,	O
many	O
references	O
can	O
be	O
found	O
to	O
integer	O
underflow	B-Algorithm
.	O
</s>
<s>
When	O
the	O
term	O
integer	O
underflow	B-Algorithm
is	O
used	O
,	O
it	O
means	O
the	O
ideal	O
result	O
was	O
closer	O
to	O
minus	O
infinity	O
than	O
the	O
output	O
type	O
's	O
representable	O
value	O
closest	O
to	O
minus	O
infinity	O
.	O
</s>
<s>
When	O
the	O
term	O
integer	O
underflow	B-Algorithm
is	O
used	O
,	O
the	O
definition	O
of	O
overflow	O
may	O
include	O
all	O
types	O
of	O
overflows	O
,	O
or	O
it	O
may	O
only	O
include	O
cases	O
where	O
the	O
ideal	O
result	O
was	O
closer	O
to	O
positive	O
infinity	O
than	O
the	O
output	O
type	O
's	O
representable	O
value	O
closest	O
to	O
positive	O
infinity	O
.	O
</s>
<s>
If	O
C	B-Language
is	O
used	O
to	O
convert	O
the	O
floating	O
point	O
value	O
127.25	O
to	O
integer	O
,	O
then	O
rounding	O
should	O
be	O
applied	O
first	O
to	O
give	O
an	O
ideal	O
integer	O
output	O
of	O
127	O
.	O
</s>
<s>
Since	O
the	O
rounded	O
integer	O
is	O
in	O
the	O
outputs	O
range	O
,	O
the	O
C	B-Language
standard	O
would	O
not	O
classify	O
this	O
conversion	O
as	O
an	O
overflow	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
the	O
language	O
Rust	B-Application
,	O
while	O
functionality	O
is	O
provided	O
to	O
give	O
users	O
choice	O
and	O
control	O
,	O
the	O
behavior	O
for	O
basic	O
use	O
of	O
mathematic	O
operators	O
is	O
naturally	O
fixed	O
;	O
however	O
,	O
this	O
fixed	O
behavior	O
differs	O
between	O
a	O
program	O
built	O
in	O
'	O
debug	O
 '	O
mode	O
and	O
one	O
built	O
in	O
'	O
release	O
 '	O
mode	O
.	O
</s>
<s>
In	O
C	B-Language
,	O
unsigned	O
integer	O
overflow	O
is	O
defined	O
to	O
wrap	O
around	O
,	O
while	O
signed	B-Algorithm
integer	I-Algorithm
overflow	O
causes	O
undefined	B-Language
behavior	I-Language
.	O
</s>
<s>
+	O
Integer	O
overflow	O
handling	O
in	O
various	O
programming	O
languages	O
Language	O
Unsigned	O
integer	O
Signed	B-Algorithm
integer	I-Algorithm
Ada	B-Language
modulo	O
the	O
type	O
's	O
modulus	O
raise	O
Constraint_Error	O
C	B-Language
,	O
C++	B-Language
modulo	O
power	O
of	O
two	O
undefined	B-Language
behavior	I-Language
C#	B-Application
modulo	O
power	O
of	O
2	O
in	O
unchecked	O
context	O
;	O
System.OverflowException	O
is	O
raised	O
in	O
checked	O
context	O
Java	B-Language
modulo	O
power	O
of	O
two	O
(	O
char	O
is	O
the	O
only	O
unsigned	O
primitive	O
type	O
in	O
Java	B-Language
)	O
modulo	O
power	O
of	O
two	O
JavaScript	B-Language
all	O
numbers	O
are	O
double-precision	O
floating-point	O
except	O
the	O
new	O
BigInt	B-Algorithm
MATLAB	B-Language
Builtin	O
integers	O
saturate	O
.	O
</s>
<s>
Fixed-point	O
integers	O
configurable	O
to	O
wrap	O
or	O
saturate	O
Python	B-Language
2	O
convert	O
to	O
long	O
type	O
(	O
bigint	B-Algorithm
)	O
Seed7	B-Language
raise	O
OVERFLOW_ERRORSeed7	O
manual	O
,	O
section	O
16.3.3	O
OVERFLOW_ERROR	O
.	O
</s>
<s>
Scheme	B-Language
convert	O
to	O
bigNum	B-Algorithm
Simulink	B-Application
configurable	O
to	O
wrap	O
or	O
saturate	O
Smalltalk	B-Application
convert	O
to	O
LargeInteger	O
Swift	B-Application
Causes	O
error	O
unless	O
using	O
special	O
overflow	O
operators.The	O
Swift	B-Application
Programming	I-Application
Language	I-Application
.	O
</s>
<s>
Swift	B-Application
2.1	O
Edition	O
.	O
</s>
<s>
Run-time	O
overflow	O
detection	O
implementation	O
UBSan	O
(	O
undefined	B-Language
behavior	I-Language
sanitizer	O
)	O
is	O
available	O
for	O
C	B-Language
compilers	B-Language
.	O
</s>
<s>
In	O
Java	B-Language
8	O
,	O
there	O
are	O
overloaded	B-Language
methods	I-Language
,	O
for	O
example	O
,	O
which	O
will	O
throw	O
an	O
in	O
case	O
of	O
overflow	O
.	O
</s>
<s>
Computer	O
emergency	O
response	O
team	O
(	O
CERT	O
)	O
developed	O
the	O
As-if	O
Infinitely	O
Ranged	O
(	O
AIR	O
)	O
integer	O
model	O
,	O
a	O
largely	O
automated	O
mechanism	O
to	O
eliminate	O
integer	O
overflow	O
and	O
truncation	O
in	O
C/C	O
++	O
using	O
run-time	O
error	O
handling	O
.	O
</s>
<s>
Static	O
analysis	O
tools	O
,	O
formal	O
verification	O
and	O
design	B-Application
by	I-Application
contract	I-Application
techniques	O
can	O
be	O
used	O
to	O
more	O
confidently	O
and	O
robustly	O
ensure	O
that	O
an	O
overflow	O
cannot	O
accidentally	O
result	O
.	O
</s>
<s>
CPUs	B-General_Concept
generally	O
have	O
a	O
way	O
to	O
detect	O
this	O
to	O
support	O
addition	O
of	O
numbers	O
larger	O
than	O
their	O
register	O
size	O
,	O
typically	O
using	O
a	O
status	O
bit	O
.	O
</s>
<s>
Thus	O
,	O
it	O
is	O
possible	O
to	O
add	O
two	O
numbers	O
each	O
two	O
bytes	O
wide	O
using	O
just	O
a	O
byte	O
addition	O
in	O
steps	O
:	O
first	O
add	O
the	O
low	O
bytes	O
then	O
add	O
the	O
high	O
bytes	O
,	O
but	O
if	O
it	O
is	O
necessary	O
to	O
carry	O
out	O
of	O
the	O
low	O
bytes	O
this	O
is	O
arithmetic	B-Algorithm
overflow	I-Algorithm
of	O
the	O
byte	O
addition	O
and	O
it	O
becomes	O
necessary	O
to	O
detect	O
and	O
increment	O
the	O
sum	O
of	O
the	O
high	O
bytes	O
.	O
</s>
<s>
Secondly	O
,	O
because	O
the	O
occurrence	O
of	O
overflow	O
itself	O
may	O
in	O
some	O
cases	O
be	O
undefined	B-Language
behavior	I-Language
.	O
</s>
<s>
In	O
the	O
C	B-Language
language	I-Language
,	O
overflow	O
of	O
unsigned	O
integers	O
results	O
in	O
wrapping	O
,	O
but	O
overflow	O
of	O
signed	B-Algorithm
integers	O
is	O
undefined	B-Language
behavior	I-Language
.	O
</s>
<s>
Consequently	O
,	O
a	O
C	B-Language
compiler	B-Language
is	O
free	O
to	O
assume	O
that	O
the	O
programmer	O
has	O
ensured	O
that	O
signed	B-Algorithm
overflow	O
cannot	O
possibly	O
occur	O
and	O
thus	O
it	O
may	O
silently	O
optimise	O
out	O
any	O
check	O
subsequent	O
to	O
the	O
calculation	O
that	O
involves	O
checking	O
the	O
result	O
to	O
detect	O
it	O
without	O
giving	O
the	O
programmer	O
any	O
warning	O
that	O
this	O
has	O
been	O
done	O
.	O
</s>
<s>
Such	O
values	O
are	O
sometimes	O
referred	O
to	O
as	O
NaN	O
,	O
for	O
"	O
not	O
a	O
number	O
"	O
.	O
</s>
<s>
This	O
is	O
often	O
supported	O
in	O
floating-point	O
hardware	O
called	O
FPUs	B-General_Concept
.	O
</s>
<s>
Programming	O
languages	O
implement	O
various	O
mitigation	O
methods	O
against	O
an	O
accidental	O
overflow	O
:	O
Ada	B-Language
,	O
Seed7	B-Language
,	O
and	O
certain	O
variants	O
of	O
functional	O
languages	O
trigger	O
an	O
exception	O
condition	O
on	O
overflow	O
,	O
while	O
Python	B-Language
(	O
since	O
2.4	O
)	O
seamlessly	O
converts	O
internal	O
representation	O
of	O
the	O
number	O
to	O
match	O
its	O
growth	O
,	O
eventually	O
representing	O
it	O
as	O
long	O
–	O
whose	O
ability	O
is	O
only	O
limited	O
by	O
the	O
available	O
memory	O
.	O
</s>
<s>
In	O
languages	O
with	O
native	O
support	O
for	O
arbitrary-precision	B-Algorithm
arithmetic	I-Algorithm
and	O
type	B-Language
safety	I-Language
(	O
such	O
as	O
Python	B-Language
,	O
Smalltalk	B-Application
,	O
or	O
Common	B-Language
Lisp	I-Language
)	O
,	O
numbers	O
are	O
promoted	O
to	O
a	O
larger	O
size	O
automatically	O
when	O
overflows	O
occur	O
,	O
or	O
exceptions	O
thrown	O
(	O
conditions	O
signaled	O
)	O
when	O
a	O
range	O
constraint	O
exists	O
.	O
</s>
<s>
In	O
the	O
case	O
of	O
Common	B-Language
Lisp	I-Language
,	O
this	O
is	O
possible	O
by	O
using	O
an	O
explicit	O
declaration	O
to	O
type-annotate	O
a	O
variable	O
to	O
a	O
machine-size	O
word	O
(	O
fixnum	O
)	O
and	O
lower	O
the	O
type	B-Language
safety	I-Language
level	O
to	O
zero	O
for	O
a	O
particular	O
code	O
block	O
.	O
</s>
<s>
In	O
stark	O
contrast	O
to	O
older	O
languages	O
such	O
as	O
C	B-Language
,	O
some	O
newer	O
languages	O
such	O
as	O
Rust	B-Application
provide	O
built-in	O
functions	O
that	O
allow	O
easy	O
detection	O
and	O
user	O
choice	O
over	O
how	O
overflow	O
should	O
be	O
handled	O
case-by-case	O
.	O
</s>
<s>
In	O
Rust	B-Application
,	O
while	O
use	O
of	O
basic	O
mathematic	O
operators	O
naturally	O
lacks	O
such	O
flexibility	O
,	O
users	O
can	O
alternatively	O
perform	O
calculations	O
via	O
a	O
set	O
of	O
methods	O
provided	O
by	O
each	O
of	O
the	O
integer	O
primitive	O
types	O
.	O
</s>
<s>
One	O
operation	O
that	O
one	O
may	O
want	O
to	O
support	O
is	O
brightening	O
the	O
image	O
by	O
multiplying	O
every	O
pixel	B-Algorithm
by	O
a	O
constant	O
.	O
</s>
<s>
Saturated	B-Algorithm
arithmetic	I-Algorithm
allows	O
one	O
to	O
just	O
blindly	O
multiply	O
every	O
pixel	B-Algorithm
by	O
that	O
constant	O
without	O
worrying	O
about	O
overflow	O
by	O
just	O
sticking	O
to	O
a	O
reasonable	O
outcome	O
that	O
all	O
these	O
pixels	B-Algorithm
larger	O
than	O
1	O
(	O
i.e.	O
,	O
"	O
brighter	O
than	O
white	O
"	O
)	O
just	O
become	O
white	O
and	O
all	O
values	O
"	O
darker	O
than	O
black	O
"	O
just	O
become	O
black	O
.	O
</s>
<s>
Unanticipated	O
arithmetic	B-Algorithm
overflow	I-Algorithm
is	O
a	O
fairly	O
common	O
cause	O
of	O
program	B-Error_Name
errors	I-Error_Name
.	O
</s>
<s>
Such	O
overflow	O
bugs	B-Error_Name
may	O
be	O
hard	O
to	O
discover	O
and	O
diagnose	O
because	O
they	O
may	O
manifest	O
themselves	O
only	O
for	O
very	O
large	O
input	O
data	O
sets	O
,	O
which	O
are	O
less	O
likely	O
to	O
be	O
used	O
in	O
validation	O
tests	O
.	O
</s>
<s>
Taking	O
the	O
arithmetic	O
mean	O
of	O
two	O
numbers	O
by	O
adding	O
them	O
and	O
dividing	O
by	O
two	O
,	O
as	O
done	O
in	O
many	O
search	B-Application
algorithms	I-Application
,	O
causes	O
error	O
if	O
the	O
sum	O
(	O
although	O
not	O
the	O
resulting	O
mean	O
)	O
is	O
too	O
large	O
to	O
be	O
represented	O
and	O
hence	O
overflows	O
.	O
</s>
<s>
An	O
unhandled	O
arithmetic	B-Algorithm
overflow	I-Algorithm
in	O
the	O
engine	O
steering	O
software	O
was	O
the	O
primary	O
cause	O
of	O
the	O
crash	O
of	O
the	O
1996	O
maiden	O
flight	O
of	O
the	O
Ariane	B-Language
5	I-Language
rocket	O
.	O
</s>
<s>
The	O
software	O
had	O
been	O
considered	O
bug-free	O
since	O
it	O
had	O
been	O
used	O
in	O
many	O
previous	O
flights	O
,	O
but	O
those	O
used	O
smaller	O
rockets	O
which	O
generated	O
lower	O
acceleration	O
than	O
Ariane	B-Language
5	I-Language
.	O
</s>
<s>
Frustratingly	O
,	O
the	O
part	O
of	O
the	O
software	O
in	O
which	O
the	O
overflow	O
error	O
occurred	O
was	O
not	O
even	O
required	O
to	O
be	O
running	O
for	O
the	O
Ariane	B-Language
5	I-Language
at	O
the	O
time	O
that	O
it	O
caused	O
the	O
rocket	O
to	O
fail	O
:	O
it	O
was	O
a	O
launch-regime	O
process	O
for	O
a	O
smaller	O
predecessor	O
of	O
the	O
Ariane	B-Language
5	I-Language
that	O
had	O
remained	O
in	O
the	O
software	O
when	O
it	O
was	O
adapted	O
for	O
the	O
new	O
rocket	O
.	O
</s>
<s>
On	O
30	O
April	O
2015	O
,	O
the	O
U.S.	O
Federal	O
Aviation	O
Administration	O
announced	O
it	O
will	O
order	O
Boeing	O
787	O
operators	O
to	O
reset	O
its	O
electrical	O
system	O
periodically	O
,	O
to	O
avoid	O
an	O
integer	O
overflow	O
which	O
could	O
lead	O
to	O
loss	O
of	O
electrical	O
power	O
and	O
ram	B-Algorithm
air	I-Algorithm
turbine	I-Algorithm
deployment	O
,	O
and	O
Boeing	O
deployed	O
a	O
software	O
update	O
in	O
the	O
fourth	O
quarter	O
.	O
</s>
<s>
The	O
error	O
happens	O
after	O
231	O
hundredths	O
of	O
a	O
second	O
(	O
about	O
days	O
)	O
,	O
indicating	O
a	O
32-bit	O
signed	B-Algorithm
integer	I-Algorithm
.	O
</s>
<s>
Overflow	O
bugs	B-Error_Name
are	O
evident	O
in	O
some	O
computer	O
games	O
.	O
</s>
<s>
In	O
Super	B-Application
Mario	I-Application
Bros	I-Application
.	I-Application
for	O
the	O
NES	B-Language
,	O
the	O
stored	O
number	O
of	O
lives	O
is	O
a	O
signed	B-Algorithm
byte	O
(	O
ranging	O
from	O
−128	O
to	O
127	O
)	O
meaning	O
the	O
player	O
can	O
safely	O
have	O
127	O
lives	O
,	O
but	O
when	O
the	O
player	O
reaches	O
their	O
128th	O
life	O
,	O
the	O
counter	O
rolls	O
over	O
to	O
zero	O
lives	O
(	O
although	O
the	O
number	O
counter	O
is	O
glitched	O
before	O
this	O
happens	O
)	O
and	O
stops	O
keeping	O
count	O
.	O
</s>
<s>
In	O
the	O
arcade	O
game	O
Donkey	B-Application
Kong	I-Application
,	O
it	O
is	O
impossible	O
to	O
advance	O
past	O
level	O
22	O
due	O
to	O
an	O
integer	O
overflow	O
in	O
its	O
time/bonus	O
.	O
</s>
<s>
In	O
Donkey	B-Application
Kong	I-Application
Jr.	O
</s>
<s>
Overflow	O
is	O
the	O
cause	O
of	O
the	O
famous	O
"	O
split-screen	O
"	O
level	O
in	O
Pac-Man	B-Application
.	O
</s>
<s>
Such	O
a	O
bug	B-Error_Name
also	O
caused	O
the	O
Far	O
Lands	O
in	O
Minecraft	B-Application
Java	I-Application
Edition	I-Application
which	O
existed	O
from	O
the	O
Infdev	O
development	O
period	O
to	O
Beta	O
1.7.3	O
;	O
it	O
was	O
later	O
fixed	O
in	O
Beta	O
1.8	O
.	O
</s>
<s>
The	O
same	O
bug	B-Error_Name
also	O
existed	O
in	O
Minecraft	B-Application
Bedrock	O
Edition	O
but	O
has	O
since	O
been	O
fixed	O
.	O
</s>
<s>
In	O
the	O
Super	B-Application
Nintendo	I-Application
Entertainment	I-Application
System	I-Application
(	O
SNES	B-Application
)	O
game	O
Lamborghini	B-Application
American	I-Application
Challenge	I-Application
,	O
the	O
player	O
can	O
cause	O
their	O
amount	O
of	O
money	O
to	O
drop	O
below	O
$0	O
during	O
a	O
race	O
by	O
being	O
fined	O
over	O
the	O
limit	O
of	O
remaining	O
money	O
after	O
paying	O
the	O
fee	O
for	O
a	O
race	O
,	O
which	O
glitches	O
the	O
integer	O
and	O
grants	O
the	O
player	O
$	O
65,535,000	O
more	O
than	O
it	O
would	O
have	O
had	O
after	O
going	O
negative	O
.	O
</s>
<s>
:	O
Clear	B-Application
Sky	I-Application
where	O
the	O
player	O
can	O
drop	O
into	O
a	O
negative	O
amount	O
by	O
fast	O
travelling	O
without	O
sufficient	O
funds	O
,	O
then	O
proceeding	O
to	O
the	O
event	O
where	O
the	O
player	O
gets	O
robbed	O
and	O
has	O
all	O
of	O
their	O
currency	O
taken	O
away	O
.	O
</s>
<s>
IBM	O
–	O
Microsoft	B-Application
Macro	I-Application
Assembler	I-Application
(	O
MASM	B-Application
)	O
version	O
1.00	O
,	O
and	O
likely	O
all	O
other	O
programs	O
built	O
by	O
the	O
same	O
Pascal	B-Application
compiler	B-Language
,	O
had	O
an	O
integer	O
overflow	O
and	O
signedness	O
error	O
in	O
the	O
stack	O
setup	O
code	O
,	O
which	O
prevented	O
them	O
from	O
running	O
on	O
newer	O
DOS	B-Device
machines	O
or	O
emulators	O
under	O
some	O
common	O
configurations	O
with	O
more	O
than	O
512	O
KB	O
of	O
memory	O
.	O
</s>
<s>
The	O
program	O
either	O
hangs	O
or	O
displays	O
an	O
error	O
message	O
and	O
exits	O
to	O
DOS	B-Device
.	O
</s>
<s>
In	O
August	O
2016	O
,	O
a	O
casino	B-Application
machine	O
at	O
Resorts	O
World	O
casino	B-Application
printed	O
a	O
prize	O
ticket	O
of	O
$	O
42,949,672	O
.76	O
as	O
a	O
result	O
of	O
an	O
overflow	O
bug	B-Error_Name
.	O
</s>
<s>
The	O
casino	B-Application
refused	O
to	O
pay	O
this	O
amount	O
,	O
calling	O
it	O
a	O
malfunction	O
,	O
using	O
in	O
their	O
defense	O
that	O
the	O
machine	O
clearly	O
stated	O
that	O
the	O
maximum	O
payout	O
was	O
$10	O
,	O
000	O
,	O
so	O
any	O
prize	O
exceeding	O
that	O
had	O
to	O
be	O
the	O
result	O
of	O
a	O
programming	B-Error_Name
bug	I-Error_Name
.	O
</s>
<s>
The	O
New	O
York	O
State	O
Gaming	O
Commission	O
ruled	O
in	O
favor	O
of	O
the	O
casino	B-Application
.	O
</s>
