Changes between Version 28 and Version 29 of NumericTower


Ignore:
Timestamp:
11/07/13 12:46:53 (4 years ago)
Author:
cowan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NumericTower

    v28 v29  
    11== The numeric tower == 
    22 
    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. 
     3This 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. 
    44 
    55There are therefore 16 possible numeric towers.  9 of them are known to have implementations, as shown below.  I write `+` if a feature is present and `-` if it is absent, and give a general description of the resulting tower and some Scheme implementations that provide it. 
    66 
    77||`exactness-preserving`||`ratios`||`inexact`||`complex`||Description||Implementations 
    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)|| 
    1111||-||+||+||+||Limited-range exact and inexact numbers||S7, Wraith|| 
    1212||+||-||+||-||Exact integers and inexact real numbers||Bigloo, Scheme 9, Elk (also ISLisp)|| 
    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 
    1515||+||+||+||-||Real numbers only||Psyche, Ikarus, Rep, Dfsch (also Clojure)|| 
    1616||+||+||+||+||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)|| 
    1717 
    18 *These systems are technically exactness-preserving, but silently return the wrong answers when their arithmetic operations overflow. 
     18*These systems are technically exactness-preserving, but silently return the wrong answers when their arithmetic operations overflow.  This makes them non-conformant. 
    1919 
    20 In my opinion, the reasonable general-purpose towers are --+- (fixnums and flonums), +-+- (fixnums, bignums, and flonums), and ++++ (full). 
     20== Opinions == 
     21 
     22In 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. 
    2123 
    2224See NumericTowerManisComments for Vincent Manis's comments on an earlier version of this page. 
     25 
     26== See also == 
    2327 
    2428See also ComplexRepresentations for information on which Schemes support exact, inexact, and mixed-exactness complex numbers.