| ID | e49717b9-c45d-433c-954e-fd9517a52476 |
|---|---|
| DeertopiaVisibility | public |
| ROAM_ALIASES | R5RS |
| ROAM_REFS | [cite:@abelson1998revised] |
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,
number?,complex?,real?,rational?,and
integer?.
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.