INTEGER-ONLY CELESTIAL NAVIGATION

a visual tour of astro-nav-int — an integer-only shipping runtime for celestial navigation

A QUESTION FROM THE CELESTIAL-NAVIGATION COMMUNITY
“From a certain perspective, celestial navigation calculations were always integer-only. In mathematical computation this would usually be termed fixed-point arithmetic. Especially in the Age of Sail, navigators worked spherical trigonometry by adding up five- or six-digit logarithms. When you see the work on paper, they're doing plain addition of five- or six-digit integers.”
THE SHORT ANSWER
Exactly right — traditional tabular reduction was fixed-point in spirit, and this project does not claim new mathematics. Its narrower claim is about the executable artifact: the shipping C library and CLI represent runtime quantities on explicit integer scales and perform the navigation calculations, including trigonometry and ephemerides, without IEEE-754 operations or libm. The tested builds reproduce their pinned schedules bit for bit. That is a determinism and constrained- computer experiment, not an accuracy advantage over binary floating point. The pages below make the distinction concrete with verbatim runs of the shipped program.
WHERE THE FRACTION LIVES

Not old math vs new math. In tables and in this library the fraction sits in a scale agreed in advance — five decimal places, or a fixed binary denominator like 248. In floating point every value carries its own movable exponent, and the scale travels with the data instead of the design.

WHERE THE HARD FUNCTIONS COME FROM

Sines and logarithms are transcendental; someone must supply them. The navigator's came from books computed before the voyage. A conventional C program often gets them from libm at runtime. Here they come from integer ladders (48-step CORDIC) and a small angle table the library builds once, at init, by integer series.

WHAT THE MACHINE EXECUTES

The checkable claim is at the instruction level: the shipping images contain no floating-point operation and import no math library. Host builds pass compile and symbol audits; five ARM/RISC-V configurations run separate freestanding profiles under QEMU, with symbol and opcode audits and hashes matched to the host. Offline reference generators and the native-double test build deliberately use floating point; they are outside the shipping runtime claim.

1700s–1900s log tables + haversines fixed point, computed by hand MID-20TH C.→ binary floating point sin/cos from a math library astro-nav-int machine fixed point int64 + shift/add, no FPU, no libm
THREE DEEP-DIVE PAGES — each card opens one
PAGE 1

One Sight, Three Traditions

One sight, three ways — Age-of-Sail log-haversine addition, floating point, and integer CORDIC — all landing on Hc 66.68°.

OPEN →
PAGE 2

Human vs Machine

A written sextant reading has an exact scaled-integer encoding; binary64 stores a nearby binary fraction. This page separates representation error from observational error.

OPEN →
PAGE 3

The Navigation Chain

A guided tour from clock to fix in eight CLI verbs, followed by one coherent synthetic Sun sight through prediction, correction, and reduction. Every command block is a verbatim transcript.

OPEN →
UNDER THE HOOD — fp_math.h

These pages show the navigation layer. For how the main functions themselves stay integer-only — the fixed-point formats and the shift-and-add ladders behind sin, cos and atan2 in the single-header fp_math.h — see the companion visualization of the underlying math library.

nmicic.github.io/int-llm/viz →
Not faster by defaultHardware doubles win the arithmetic race on a laptop (~32 ns vs ~300 ns per sight for the CORDIC path). Only the vector-almanac method wins (~7 ns) — by changing the representation, not by racing.
Not mathematically exactFinite scales, truncated series, and rounding remain — declared and gated (0.01° output grid, at most 0.30′ rounding on that grid, plus separate arcminute-level almanac budgets) rather than hidden.
Not board-measured yetThe five embedded targets run under QEMU emulation, not on physical silicon; instruction counts are architectural, not cycle-accurate.
Not a navigation instrumentAn experimental research library with computational validation; it has not yet ridden a real sextant through a real field trial.
Every block labelled as a CLI transcript is unedited output of the shipped sight_reduction binary (v0.1.0). Its 4096-case determinism schedule is pinned to the golden hash 0x3d6ddb7b86f2c7d2 on x86-64 (gcc and clang) and arm64 (clang); five freestanding embedded targets under QEMU match the host's per-feature hashes bit for bit. Source, tests, and validation gates: github.com/nmicic/astro-nav-int. Companion visualizations of the underlying integer math library: nmicic.github.io/int-llm/viz.