integer
Let an agent reason about integers mathematically and in computing, where fixed-width representations add overflow and signedness issues.
Research draft, second pass
A second pass drafted this model: the structure a model of this thing needs, and what is known about it in the world. The line under this one says how the second half was obtained - researched against sources, or recalled without web access, in which case nothing here was read anywhere and every claim is a lead to verify. Unreviewed either way.
written by Claude from model knowledge without web access - no source was read, every claim is a lead to verify
Researched by: Claude
Purpose and description
Let an agent reason about integers mathematically and in computing, where fixed-width representations add overflow and signedness issues.
A number that is zero, a positive whole number or the negative of one: ..., -2, -1, 0, 1, 2, ...; the set Z.
What it is for: Counting, indexing, identifiers and exact arithmetic.
It can be add, subtract and multiply, staying within the integers; divide with remainder; store it, in fixed or arbitrary precision; use it as an identifier, such as a process id or block address.
Distinguishing features
Whole numbers, positive, negative and zero
Closed under addition, subtraction and multiplication, not division
Computer integers have fixed ranges unless arbitrary precision
Numeric identifiers are not quantities
What it looks like
Digits without a fractional part, optionally with a minus sign.
Physical character
int32 range: -2147483648 to 2147483647 dimensionless
int64 maximum: 9223372036854775807 dimensionless
How it is recognised
Numerals with no decimal point
Types such as int32, int64, BigInt in code
Identifiers that look like integers are labels, not quantities
Related models
is a kind of - the set Z
has property - positive, negative or zero
is used as - numeric labels
is confused with - approximate reals
In practice
Families and kinds
natural numbers and non-negative integers
even and odd integers
primes
signed and unsigned machine integers
Identifiers
OEIS A-numbers integer sequences
Standards and regulation
ISO 80000-2 notation
ISO/IEC 9899 C and other language standards defining integer types
Failure modes and hazards
Integer overflow and wraparound
Signed and unsigned mismatches
Rounding when integers pass through floating point, such as in JSON beyond 2^53
Doing arithmetic on identifiers
Also called
+13
Where this came from
wikidata · CC0 1.0
Also registered as vr.tr.integer
Drafted structure
Bundle to layer to finding to question, as the second pass will find it: 4 bundles · 8 layers · 8 findings · 16 questions.
Mathematics Properties of integers.
Mathematical properties underpin all use.
Arithmetic
Operations and closure.
Operations
Operations and results.
- Does the operation stay within the integers? definition
- How is division with remainder defined here for negatives? boundary
Properties
Parity, primality, divisibility.
Properties
Number-theoretic properties.
- Is it even or odd, prime or composite? measurement
- What are its divisors? measurement
Representation In computers.
Fixed-width integers behave differently from mathematical ones.
Width and sign
int32, int64, unsigned.
Type
The type and range.
- Which integer type holds this value, and what is its range? definition
- Is it signed or unsigned? definition
Overflow
Wraparound and errors.
Overflow handling
How overflow is handled.
- Can this calculation overflow? boundary
- Is overflow checked, wrapped or saturated? definition
Interchange Passing integers between systems.
Formats can silently lose precision.
Formats
JSON, CSV, databases.
Format limits
Limits of formats.
- Will this integer survive the format without loss? boundary
- Should it be sent as a string? action
Parsing
Leading zeros and separators.
Parsing rules
Parsing rules.
- How are leading zeros and separators handled? boundary
- Is the value an identifier rather than a number? definition
Identifiers Integers as labels.
Many integers are labels, not quantities.
Label or quantity
Nature of the value.
Nature
Whether the integer is a label.
- Is this integer a quantity or a label? definition
- What operations make sense on it? boundary
Uniqueness
Scope of identifiers.
Scope
Where the identifier is unique.
- Within what scope is this identifier unique? boundary
- Can it be reused? boundary
What the second pass must settle
- Should machine integer types be separate entries?
- How should identifiers be marked so they are not treated as quantities?
- The registry entry has merged aliases such as house numbers; should they be split off?