/ˈɪn-tɪ-dʒər/

noun — “a number that refuses decimals, refuses ambiguity, and generally prefers to stay whole.”

Integer is a numeric type used in computing to represent whole numbers without fractional parts. Unlike floating-point values, integers are exact within their range: no rounding, no approximation, no hidden binary drift from rounding error. If a value is an integer, it is either fully representable or it simply does not fit.

In most systems, integers are stored as fixed-width binary values. A common representation is two’s complement, which allows both positive and negative numbers within a fixed number of bits.

// 8-bit signed integer (two's complement)

00000000 = 0
00000001 = 1
01111111 = 127
11111111 = -1
10000000 = -128

This structure is deceptively simple: each bit contributes to a fixed positional value, but the highest bit acts as a sign indicator in signed formats. This allows integers to represent negative numbers without needing a separate sign mechanism.

Integers come in different sizes depending on how much memory is allocated:

// common integer widths

8-bit   → -128 to 127
16-bit  → -32,768 to 32,767
32-bit  → -2,147,483,648 to 2,147,483,647
64-bit  → extremely large range

Unlike floating-point numbers, integers do not encode exponent or fractional structure. This makes them ideal for counting, indexing, and representing discrete entities such as array positions, IDs, or bit flags.

However, integers are not infinite. When a value exceeds the maximum representable range, an overflow occurs. Depending on the system, this may wrap around, clamp, or trigger an error.

// integer overflow example (conceptual)

127 + 1 → -128   (in 8-bit signed arithmetic)

This behavior is not a rounding issue but a boundary limitation: integers are exact until they suddenly are not representable at all. This contrasts sharply with floats, where values are always approximate but rarely “fail” outright.

Conceptually, integers are the “digital counting language” of computing. Everything that can be discretized tends to become an integer: array indices, loop counters, memory addresses, permissions masks, and enumeration states.

In fact, many higher-level abstractions quietly collapse into integers under the surface. For example:

  • Boolean values are often stored as 0 or 1
  • Character codes map letters to integer values (e.g., ASCII, Unicode code points)
  • Bit flags encode multiple states inside a single integer

This makes integers one of the most fundamental building blocks in computing. They are simple, fast, and predictable—qualities that make them ideal for low-level operations and performance-critical code.

Unlike decimal or floating-point systems, integers have no internal notion of fractions or scaling. A number is either whole or it is not represented. This rigidity is both their strength and limitation.

For example:

// integer division behavior

5 / 2 = 2   (not 2.5)

Here, the fractional part is discarded or handled separately depending on the language. This reinforces the idea that integers are about discrete steps, not continuous values.

Conceptually, integer is the “no-nonsense” numeric type: it counts, indexes, and enumerates without hesitation. It does not approximate, it does not drift—it simply stops when it runs out of space.

In most systems, integers and floats coexist as complementary tools: integers for structure and identity, floats for measurement and simulation. Together, they form a dual model of computation—one discrete, one continuous.

Ultimately, integer is the foundation of exactness in digital systems. It represents the part of computation where numbers are still solid, before approximation, rounding, or representation limits begin to blur the edges.

See float, binary, bit, overflow, decimal