← All notes

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

Claims

Sources

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.

License: CC-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.

Cite this

Permanent ID: iil:note:q32mcs67

iinventedlight. 2026. "Go math/big: arbitrary-precision integers, rationals, and floats." iinventedlight Library, iil:note:q32mcs67, version of 2026-11-24. https://iinventedlight.com/library/notes/go-math-big/. License: CC-BY-4.0.

@misc{iil_note_q32mcs67,
  author = {{iinventedlight}},
  title = {{Go math/big: arbitrary-precision integers, rationals, and floats}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-24},
  url = {https://iinventedlight.com/library/notes/go-math-big/},
  note = {Permanent ID iil:note:q32mcs67. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-math-big.md.