{
  "id": "integer",
  "title": "Integer",
  "lang": "en",
  "source_lang": "en",
  "summary": "An integer is zero, a positive whole number, or a negative whole number; integers form a fundamental number system closed under addition, subtraction, and multiplication.",
  "category": "mathematics",
  "subcategory": "algebra",
  "type": "concept",
  "aliases": [
    "Integers",
    "Integer number"
  ],
  "generated_at": "2026-10-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/integer/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/integer/",
      "json": "https://aiwiki.page/zh/integer.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "An integer is a number belonging to the set\n\n\\[\\mathbb Z=\\{\\ldots,-3,-2,-1,0,1,2,3,\\ldots\\}.\\]\n\nThe integers include the positive counting numbers, zero, and the negatives of the counting numbers. They exclude nonintegral quantities such as \\(1/2\\) and \\(\\sqrt2\\). In elementary mathematics, integers extend counting to quantities with opposite directions or signs, such as gains and losses or positions above and below a reference point. (openstax.org)"
    },
    {
      "heading": "Definition and place among number systems",
      "text": "The positive integers are \\(1,2,3,\\ldots\\); the negative integers are \\(-1,-2,-3,\\ldots\\). Zero is neither positive nor negative. The nonnegative integers comprise zero and the positive integers. The term “whole numbers” commonly means the nonnegative integers, whereas conventions for natural numbers differ over whether zero is included. (openstax.org)\n\nEvery integer is a rational number, since \\(n=n/1\\), and therefore also a real number. The converse does not hold: many rational and real numbers are not integers. This inclusion concerns numerical values rather than written forms. For example, \\(6/2\\) represents the integer \\(3\\), despite being written as a fraction. The rational numbers can be constructed from ratios of integers with nonzero denominators. (pancratz.org)"
    },
    {
      "heading": "Order and size",
      "text": "On a number line, integers occur at equally spaced points, with successive integers one unit apart. Numbers increase toward the right: thus \\(-5<-2<0<3\\). Every integer \\(n\\) has an immediate predecessor \\(n-1\\) and successor \\(n+1\\). There is no greatest or least integer, and no integer lies strictly between consecutive integers. (openstax.org)\n\nThe absolute value \\(|n|\\) measures an integer’s distance from zero, ignoring its sign. Thus \\(|-7|=|7|=7\\). Opposite integers have equal absolute values, but their positions and order differ. For instance, \\(-7<-4\\), although \\(7>4\\). (openstax.org)\n\nIn set theory, the integers are countably infinite. They can be listed as \\(0,1,-1,2,-2,\\ldots\\), giving a one-to-one correspondence with the nonnegative integers. Consequently, adjoining negative numbers does not increase the infinite cardinality of the natural-number system. (math.libretexts.org)"
    },
    {
      "heading": "Arithmetic and algebraic structure",
      "text": "Integer arithmetic is closed under addition, subtraction, and multiplication: applying any of these operations to two integers produces another integer. Addition and multiplication are associative and commutative, and multiplication distributes over addition. Zero is the additive identity, one is the multiplicative identity, and every integer \\(n\\) has the additive inverse \\(-n\\). (math.libretexts.org)\n\nDivision is not closed within the integers: \\(7/2\\), for example, is not an integer. Only \\(1\\) and \\(-1\\) have multiplicative inverses that are integers. Division by zero is undefined. In abstract algebra, these properties make \\(\\mathbb Z\\) a commutative ring with identity, but not a field. It is also an integral domain: a product of integers is zero only if at least one factor is zero. (math.libretexts.org)"
    },
    {
      "heading": "Formal construction",
      "text": "Integers can be constructed from natural numbers without presupposing subtraction. Taking natural numbers to include zero, consider ordered pairs \\((a,b)\\), intended to represent \\(a-b\\). Define an equivalence relation by\n\n\\[(a,b)\\sim(c,d)\\quad\\text{if and only if}\\quad a+d=b+c.\\]\n\nAn integer is then an equivalence class of such pairs. For example, \\((3,1)\\), \\((4,2)\\), and \\((2,0)\\) all represent \\(2\\). (builds.openlogicproject.org)\n\nWriting \\([(a,b)]\\) for a class, addition is defined by\n\n\\[[(a,b)]+[(c,d)]=[(a+c,b+d)].\\]\n\nNegation exchanges the coordinates. The natural number \\(n\\) corresponds to \\([(n,0)]\\), its negative to \\([(0,n)]\\), and zero to every class representative \\((a,a)\\). These definitions are independent of the representatives selected. (builds.openlogicproject.org)"
    },
    {
      "heading": "Divisibility and number theory",
      "text": "Integers are the principal objects of elementary number theory. An integer \\(a\\) divides \\(b\\) when \\(b=ak\\) for some integer \\(k\\). A prime number is a positive integer greater than one whose only positive divisors are one and itself. The fundamental theorem of arithmetic states that every integer greater than one has a unique prime factorization, apart from the order of its factors. (math.libretexts.org)\n\nThe division theorem states that, for any integer \\(a\\) and positive integer \\(b\\), unique integers \\(q,r\\) satisfy\n\n\\[a=bq+r,\\qquad 0\\le r<b.\\]\n\nIt applies to negative dividends too: \\(-7=3(-3)+2\\). Repeated division with remainder underlies the Euclidean algorithm for finding a greatest common divisor. (math.libretexts.org)\n\nIn modular arithmetic, integers \\(a,b\\) are congruent modulo a positive integer \\(m\\) when \\(m\\) divides \\(a-b\\). Congruence groups integers by their remainders; modulo two, the classes are the even and odd integers. Addition and multiplication respect congruence. (math.libretexts.org)"
    },
    {
      "heading": "Integers in computing",
      "text": "A mathematical integer has no prescribed size limit, but an integer type in a programming language may have a fixed range. Java’s int, for example, uses 32-bit signed two’s-complement representation, with values from \\(-2^{31}\\) to \\(2^{31}-1\\). Results outside that range overflow rather than remaining exact mathematical integers. (docs.oracle.com)\n\nOther implementations provide arbitrary-precision arithmetic. Python integers have unlimited precision in the language’s numeric model, although practical computations remain constrained by available memory and processing resources. This distinction separates the abstract integer system from its finite computational representations. (docs.python.org)"
    }
  ],
  "links": [
    "number",
    "zero",
    "mathematics",
    "natural-number",
    "rational-number",
    "real-number",
    "absolute-value",
    "set-theory",
    "countable-set",
    "arithmetic",
    "abstract-algebra",
    "ring-mathematics",
    "field-mathematics",
    "integral-domain",
    "equivalence-relation",
    "equivalence-class",
    "number-theory",
    "prime-number",
    "fundamental-theorem-of-arithmetic",
    "euclidean-algorithm",
    "modular-arithmetic",
    "programming-language"
  ],
  "sources": [
    {
      "title": "openstax.org/books/prealgebra/pages/3-1-introduction-to-integers",
      "url": "https://openstax.org/books/prealgebra/pages/3-1-introduction-to-integers"
    },
    {
      "title": "pancratz.org/notes/Numbers.pdf",
      "url": "https://www.pancratz.org/notes/Numbers.pdf"
    },
    {
      "title": "openstax.org/books/contemporary-mathematics/pages/3-2-the-integers",
      "url": "https://openstax.org/books/contemporary-mathematics/pages/3-2-the-integers"
    },
    {
      "title": "math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementa…",
      "url": "https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Foundations%3A_An_Introduction_to_Topics_in_Discrete_Mathematics_%28Sylvestre%29/13%3A_Countable_and_uncountable_sets/13.01%3A_Basics_and_Examples"
    },
    {
      "title": "math.libretexts.org/Bookshelves/Abstract_and_Geometric_Algebra/Abstract_Algebra…",
      "url": "https://math.libretexts.org/Bookshelves/Abstract_and_Geometric_Algebra/Abstract_Algebra%3A_Theory_and_Applications_%28Judson%29/16%3A_Rings"
    },
    {
      "title": "math.libretexts.org/Bookshelves/Abstract_and_Geometric_Algebra/Abstract_Algebra…",
      "url": "https://math.libretexts.org/Bookshelves/Abstract_and_Geometric_Algebra/Abstract_Algebra%3A_Theory_and_Applications_%28Judson%29/16%3A_Rings/16.04%3A_Integral_Domains_and_Fields"
    },
    {
      "title": "builds.openlogicproject.org/content/sets-functions-relations/arithmetization/in…",
      "url": "https://builds.openlogicproject.org/content/sets-functions-relations/arithmetization/integers.pdf"
    },
    {
      "title": "math.libretexts.org/Bookshelves/Abstract_and_Geometric_Algebra/Abstract_Algebra…",
      "url": "https://math.libretexts.org/Bookshelves/Abstract_and_Geometric_Algebra/Abstract_Algebra%3A_Theory_and_Applications_%28Judson%29/02%3A_The_Integers/2.02%3A_The_Division_Algorithm"
    },
    {
      "title": "math.libretexts.org/Bookshelves/Mathematical_Logic_and_Proof/Proofs_and_Concept…",
      "url": "https://math.libretexts.org/Bookshelves/Mathematical_Logic_and_Proof/Proofs_and_Concepts_-_The_Fundamentals_of_Abstract_Mathematics_%28Morris_and_Morris%29/07%3A_Equivalence_relations/7.04%3A_Modular_arithmetic"
    },
    {
      "title": "docs.oracle.com/javase/specs/jls/se22/html/jls-4.html",
      "url": "https://docs.oracle.com/javase/specs/jls/se22/html/jls-4.html"
    },
    {
      "title": "docs.python.org/3.10/library/stdtypes.html",
      "url": "https://docs.python.org/3.10/library/stdtypes.html"
    }
  ],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}