Exact and Inexact Numbers

Lispex has arbitrary-precision exact integers, reduced exact rationals, and finite IEEE-754 reals with canonical positional rendering.

At a glance

LISPEX
(list (/ 1 3) (+ 1 2.0) (number->string -0.0))

Result

OUTPUT
(1/3 3.0 "-0.0")

Current guarantees

  • Exact arithmetic stays exact; + - * / become inexact if any operand is inexact. Comparisons use exact mixed-number comparison.
  • No infinity or NaN value can enter the runtime; division by zero is E313 and non-finite production is E314.
  • Finite real output is shortest round-trip, positional only, with a forced .0 and preserved -0.0.

Boundaries

  • Complex numbers and platform-libm transcendentals are excluded.
  • Exact/inexact contagion for arithmetic must not be generalized to selection or comparison semantics.