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`. These refer respectively to the closure of exact numbers under rational operations (except `/`), exact non-integer values, inexact rationals, and non-real numbers. |
| 3 | This is an analysis of the R5RS provision that the full numeric tower may be subsetted. In this analysis, four boolean feature settings characterize different kinds of numeric towers: `exactness-preserving`, `ratios`, `inexact`, and `complex`. These refer respectively to the closure of exact numbers under rational operations (except `/`), exact non-integer values, inexact rationals, and non-real numbers. |
8 | | ||-||-||-||-||A "toy" tower with bounded exact integers only (possibly appropriate where no numerical work will be done)||!SigScheme*|| |
9 | | ||-||-||+||-||Fixnums and flonums (all arithmetic runs in essentially constant time)||Plain Chicken, Shoe*, !TinyScheme*, RScheme, JScheme*, BDC*, XLisp*, Schemik*, VX, SXM*, Inlab, Llava, Sixx, Sizzle, Dfsch*, Stalin (also Elisp*, C*)|| |
10 | | ||-||+||+||1||Limited-range exact and inexact real numbers||NexJ (also Java)|| |
| 8 | ||-||-||-||-||Bounded exact integers only||!SigScheme*|| |
| 9 | ||-||-||+||-||Fixnums and flonums||Plain Chicken, Shoe*, !TinyScheme*, RScheme, JScheme*, BDC*, XLisp*, Schemik*, VX, SXM*, Inlab, Llava, Sixx, Sizzle, Dfsch*, Stalin (also Elisp*, C*)|| |
| 10 | ||-||+||+||-||Limited-range exact and inexact real numbers||NexJ (also Java)|| |
13 | | ||+||-||+||+||Exact integers, inexact real numbers, and inexact complex numbers||SCM|| |
14 | | ||+||+||-||-||Exact rational numbers only (reasonable for some purposes, but will often run very slowly without inexact support, so unsuitable for scientific-type work)||Dream, Oaklisp, Owl Lisp|| |
| 13 | ||+||-||+||+||Exact integers, inexact real numbers, and complex numbers||SCM|| |
| 14 | ||+||+||-||-||Exact rational numbers only||Dream, Oaklisp, Owl Lisp |
15 | 15 | ||+||+||+||-||Real numbers only||Psyche, Ikarus, Rep, Dfsch (also Clojure)|| |
16 | 16 | ||+||+||+||+||Full numeric tower||Racket, Gauche, MIT, Gambit, Chicken with the `numbers` egg, Scheme48/scsh, Kawa, SISC, Chibi, Guile, Chez, Vicare, Larceny, Ypsilon, Mosh, !IronScheme, STklos, KSi, UMB, Spark (also R6RS, Common Lisp, Pure)|| |
17 | 17 | |
20 | | In my opinion, the reasonable general-purpose towers are --+- (fixnums and flonums), +-+- (fixnums, bignums, and flonums), and ++++ (full). |
| 20 | == Opinions == |
| 21 | |
| 22 | In my opinion, the reasonable general-purpose towers are --+- (fixnums and flonums), +-+- (fixnums, bignums, and flonums), +++- (fixnums, bignums, ratnums, and flonums) and ++++ (full). The --+- tower's operations have the advantage of running in constant time on modern hardware. The ++-- tower (ratnums but not flonums) may be reasonable for some purposes, but numerical code will often run very slowly without inexact support due to fractions which grow larger and larger. The ---- (fixnum-only) tower might possibly be appropriate where only a tiny amount of space is available and essentially no numerical work will be done. |