Numerical tower
|
In computing, a numerical tower is the set of number types (datatypes that represent numbers) in a given programming language.
The Scheme standard defines the following:
+-------+ |Integer| +---------+ | Rational| +-----------+ | Real | +-------------+ | Complex | +---------------+ | Number | +---------------+
Each type in the tower conceptually "sits on" a more fundamental type, so an Integer is a Rational is a ... Number, but the inverse is not necessarily true.
Typically a language will support a modified version of this numerical tower; Kawa Scheme, for example, extends this basic numerical tower with a Quantity type that's even more general than Number. Another popular variant is having both exact and inexact versions of the tower or parts of it. Some languages and language implementations do not support a full numerical tower or support it only in a limited way.