Revised⁵ Report on the Algorithmic Language Scheme

The Revised⁵ Report on the Algorithmic Language Scheme (R⁵RS) is the fifth iteration of the Scheme programming language.

Unless otherwise stated, "R⁵RS," "the report," and "Scheme" are used interchangeably within this document.

The numeric tower

R⁵RS defines a minimal hierarchy of numeric types commonly referred to as the "numeric tower." Defined by predicates, these types are, in order of descending generality,

Every integer is a rational, every rational is a real, and so on. Implementations are not required to implement the entire tower, but rather a "coherent subset."[cite:@abelson1998revised]

Scheme defines no straightforward relationship between a number's type and its low-level representation.[cite:@abelson1998revised]

Exactness

While Scheme does not enforce anything concrete about the low-level representation of numbers, it does define exactness. every number in Scheme satisfies exactly one of exact? or inexact?.[cite:@abelson1998revised]

With the sole exception of inexact->exact, all numeric operations defined by the report must return an inexact result when given any inexact arguments, unless the implementation can prove that the result is unaffected by the inexactness of its arguments. For example, multiplication of any number, exact or inexact, against an exact zero may return an exact zero.