3 | | This is an analysis of the R5RS provision that the full numeric tower may be subsetted. Four boolean feature settings characterize different kinds of numeric towers: `exactness-preserving`, `ratios`, `inexact`, and `complex`, which refer to the closure of exact numbers under rational operations (except `/`), exact non-integer values, inexact rationals, and non-real numbers, respectively. A priori, any combination of these features might be implemented, except that `ratios` makes no sense without `exactness-preserving`. I also assume that `complex` makes no sense without either `ratios` or `inexact`: Gaussian integers by themselves seem to be of little use. |
| 3 | This is an analysis of the R5RS provision that the full numeric tower may be subsetted. Five boolean feature settings characterize different kinds of numeric towers: `exactness-preserving`, `ratios`, `inexact`, and `complex`, and `exact-complex`. These refer respectively to the closure of exact numbers under rational operations (except `/`), exact non-integer values, inexact rationals, non-real numbers, and exact non-real numbers. Of course, `exact-complex` can only be true if `complex` is true. |
7 | | |
8 | | ||exactness-preserving||ratios||inexact||complex||Description|| |
9 | | ||-||-||-||-||A "toy" tower with fixnums (bounded exact integers) only. Possibly appropriate where no numerical work will be done. SSCM, !SigScheme provide this.|| |
10 | | ||-||-||+||-||A Scheme where all numbers are real and all arithmetic happens in essentially constant time. Chicken provides this unless you import the `numbers` egg. Sixx, Sizzle provide this. Most non-Lisp languages are like this, except that their fixnums wrap on overflow instead of switching to flonums, producing grossly incorrect results.|| |
11 | | ||-||-||+||+||The complex-number equivalent of the preceding. Non-real numbers are typically inexact/inexact. Stalin provides this.|| |
12 | | ||+||-||-||-||Unlimited-precision integers only. Possibly usable for crypto work. Fortunately, ratios are fairly cheap given bignums.|| |
13 | | ||+||-||+||-||A good all-round compromise, providing exact integers and inexact real numbers. ISLisp requires this. Bigloo, Chibi, Scheme 9 provide this. Many people seem to like this tower.|| |
14 | | ||+||-||+||+||The same as the preceding, but with inexact/inexact non-real numbers as well. SCM provides this.|| |
15 | | ||+||+||-||-||Exact rational numbers only. Dream provides this. Reasonable for some purposes, but will often run very slowly without inexact support, so unsuitable for scientific-type work.|| |
16 | | ||+||-||+||+||The same as the preceding, but with exact general complex numbers. Even less suitable for scientific-type work, given that in practice non-real numbers are usually inexact/inexact.|| |
17 | | ||+||+||+||-||Full numeric tower for real numbers only. Psyche provides this.|| |
18 | | ||+||+||+||+||Full numeric tower. R6RS and CL require this. Racket, Gauche, MIT, Gambit, Chicken with the `numbers` egg, Scheme48/scsh, Kawa, Chez, STklos provide this. Guile, SISC provide this with inexact/inexact complex numbers only. Many people seem to like this tower.|| |
| 7 | ||`exactness-preserving`||`ratios`||`inexact`||`complex`||`exact-complex`||Description||Examples |
| 8 | ||-||-||-||-||-||A "toy" tower with fixnums (bounded exact integers) only. Possibly appropriate where no numerical work will be done.||!SigScheme|| |
| 9 | ||-||-||+||-||-||A Scheme where all numbers are real and all arithmetic happens in essentially constant time.||Chicken (default), Oaklisp, Sixx, Sizzle|| |
| 10 | ||-||-||+||+||-||The complex-number equivalent of the preceding.||Stalin|| |
| 11 | ||-||+||+||+||-||Limited-range exact and inexact numbers.||Scheme 7|| |
| 12 | ||-||+||+||+||+||Limited-range exact and inexact numbers, including exact non-reals.||Wraith|| |
| 13 | ||+||-||-||-||-||Unlimited-range integers only. Possibly usable for crypto work. Fortunately, ratios are fairly cheap given bignums.||None known|| |
| 14 | ||+||-||+||-||-||A good all-round compromise, providing exact integers and inexact real numbers.||ISLisp, Bigloo, Scheme 9, Elk|| |
| 15 | ||+||-||+||+||-||The same as the preceding, but with inexact complex numbers as well.||SCM|| |
| 16 | ||+||+||-||-||-||Exact rational numbers only. Reasonable for some purposes, but will often run very slowly without inexact support, so unsuitable for scientific-type work.||Dream|| |
| 17 | ||+||-||+||+||+||The same as the preceding, but with exact non-real numbers. Even less suitable for scientific-type work, given that in practice non-real numbers are usually inexact.||None known|| |
| 18 | ||+||+||+||-||-||Full numeric tower with real numbers only.||Psyche|| |
| 19 | ||+||+||+||+||-||Full numeric tower with inexact non-reals only.||Gauche, Guile, SISC, KSi, UMB|| |
| 20 | ||+||+||+||+||+||Full numeric tower.||All R6RS systems, all CL systems, Racket, MIT, Gambit, Chicken with the `numbers` egg, Scheme48/scsh, Kawa, Chibi, Chez, STklos|| |