Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

integer
overflow
datatype

What is an integer overflow?

Educative Answers Team

When an integer is created, the computer allocates 32-bits to store its value. However, there might be data that is larger than 32- bits; for example, a sextillion (a billion trillion) is 70 digits in binary. When an integer value is larger than 32- bits, an integer overflow occurs. In case the integer value does not fit in the 32-bit block, a double data type can be used instead of int.

svg viewer

Another reason that integer overflow could occur is if a 32-bit integer was added to another 32-bit integer, and the result went up to 33-bits.

RELATED TAGS

integer
overflow
datatype
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring