A computer number format defines how a machine stores and interprets numeric values. Modern computers and many electronic calculators use binary at the hardware level: every value is ultimately composed of ones and zeros. Higher-level notations such as octal and hexadecimal provide compact ways to express binary data to humans. Different formats trade off range, precision, performance and ease of human interpretation.

Common formats and their characteristics

Typical formats include:

  • Binary — base 2, the native form inside digital logic. Bits are grouped into bytes and words for storage and processing.
  • Octal — base 8 (digits 0–7). Historically convenient for machines with word sizes that are multiples of three bits.
  • Hexadecimal — base 16 (digits 0–9 and A–F). Frequent in programming and debugging because each hex digit represents four binary bits.
  • Integer encodings — represent whole numbers; common schemes include sign‑magnitude and two's complement (the latter is dominant because it simplifies arithmetic circuits).
  • Fixed‑point — stores a scaled integer to represent fractional values, useful where predictable rounding and performance matter (e.g., embedded systems, finance).
  • Floating‑point — represents real numbers with a sign, exponent and significand (mantissa). The IEEE 754 family standardizes formats such as single (32‑bit) and double (64‑bit) precision used widely in software and hardware.
  • Binary Coded Decimal (BCD) — encodes decimal digits individually; used in some financial and legacy systems to avoid decimal-to-binary rounding issues.

History and development

Early electronic machines used binary logic; as computer architectures evolved, engineers adopted notation systems that made binary easier for humans to read. Octal and hexadecimal emerged as compact aliases for binary groups. Standards for floating point, particularly IEEE 754 introduced in the late 20th century, brought consistent behavior for rounding, overflow, underflow and special values (e.g., infinities and NaNs), which improved portability across platforms.

Uses, examples and practical importance

Different formats serve different purposes. Integers are used for counts, indices and addresses. Floating point covers scientific computation, graphics and simulations where wide dynamic range is needed. Fixed‑point and BCD appear where decimal accuracy and deterministic rounding are essential. Hex is commonly used by programmers to inspect memory, represent colors in graphics, or express bitmasks. Conversions between formats (decimal ↔ binary, integer ↔ floating point) are routine operations in compilers and libraries.

Distinctions and notable issues

Key trade-offs include precision versus range, and predictable arithmetic versus performance. Floating point provides large range but introduces rounding error and special cases (subnormal numbers, NaN). Integer representations must handle overflow and negative values correctly; two's complement simplifies hardware but imposes an asymmetric range for positives and negatives. Endianness affects byte order in memory but not the abstract numeric format. For further technical detail see general references on binary representations and numeric standards.

The choice of number format depends on application requirements: accuracy, speed, storage, and interoperability. Understanding the common schemes and their trade-offs helps programmers, engineers and users select the right representation for a task.