---
source: https://iinventedlight.com/library/notes/go-math-big.md
title: "Go math/big: arbitrary-precision integers, rationals, and floats"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (The Go Authors); BSD-3-Clause (The Go Authors); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: The Go Authors, math/big package reference; The Go Authors, math/big Int source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-24
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-24
as_of: 2026-11-24
confidence: medium
untested: "Not reproduced (2026-11-24). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go-math-big"
tags: [go, math-big, arbitrary-precision, integers, rationals]
client: Librarian
sources:
  - id: S1
    title: "math/big package reference"
    publisher: The Go Authors
    url: https://pkg.go.dev/math/big
    accessed: 2026-11-24
    license: "BSD-3-Clause"
  - id: S2
    title: "math/big Int source"
    publisher: The Go Authors
    url: https://go.dev/src/math/big/int.go
    accessed: 2026-11-24
    license: "BSD-3-Clause"
---
# Go math/big: arbitrary-precision integers, rationals, and floats
**Answer:** The big package implements arbitrary-precision arithmetic on integers, rationals, and floating-point numbers.

## Types and zero values

The supported numeric types are Int for signed integers, Rat for rational numbers, and Float for floating-point numbers.

The zero value for an Int, Rat, or Float corresponds to 0.

New values can be declared in the usual ways and denote 0 without further initialization.

## How Int values work

An Int represents a signed multi-precision integer.

Operations always take pointer arguments rather than Int values.

Each unique Int value requires its own unique pointer.

Shallow copies of Ints must not be used.

Copy by calling Set on an existing or newly allocated Int.

## See also

- [go-strconv](https://iinventedlight.com/library/notes/go-strconv/)
- [go-encoding-binary](https://iinventedlight.com/library/notes/go-encoding-binary/)
- [go-crypto-rand](https://iinventedlight.com/library/notes/go-crypto-rand/)

## Claims

- id: C1
  claim: The package implements arbitrary-precision arithmetic.
  source: S1
  evidence: "implements arbitrary-precision arithmetic"

- id: C2
  claim: The zero value for an Int, Rat, or Float corresponds to 0.
  source: S1
  evidence: "zero value for an Int , Rat , or Float correspond to 0"

- id: C3
  claim: An Int represents a signed multi-precision integer.
  source: S2
  evidence: "Int represents a signed multi-precision integer"

- id: C4
  claim: Operations always take pointer arguments rather than Int values.
  source: S2
  evidence: "Operations always take pointer arguments"

## Sources

- [S1] math/big package reference. The Go Authors. https://pkg.go.dev/math/big . License: BSD-3-Clause. Accessed 2026-11-24.

- [S2] math/big Int source. The Go Authors. https://go.dev/src/math/big/int.go . License: BSD-3-Clause. Accessed 2026-11-24.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Go Authors, math/big package reference; The Go Authors, math/big Int source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
