Numeric types:numberic type
From dis-Emi-A
Numeric Types
There are several classes of numbers in mathematics. Below is a brief overview of those.
- Integer
- a numeric integral scalar
- Rational
- a number that can be represented as x/y
- Irrational
- a non-terminating number that cannot be represented as x/y
- Real
- a 1-space scalar (incl: Algebraic and Transcendental, Rational, Irrational, Integer)
- Complex
- a 2-space plane
- Algebraic
- satisifies Pn(a)=0 for some polynomial Pn(x) with integer coefficients (incl: Integer, Rational)
- Transcendental
- (Include: Real and !Algebraic)
Hierarchy
The hierarachy of numeric types is setup that each derived type is a subclass of its parent type and can be repesented as such without loss. (A problem that appears with a non-symbolic language however is that irrationals become functionally equivalent to ration numbers, as precision is not infinite).
- Complex
- Real
- Rational
- Integer
- Irrational
- Transcendental
- Rational
- Real
"Algebraic" is an additional trait, such that a function is_algebraic returns true for all but transcendental numbers". There can be no "algrbraic" in the hierarchy as it is not a clean separation.
Transcendental's cannot be ignored as they include several commonly used constants: π e, √2
Additionally, the full known class of a number is available to compilers that wish to do intelligent compilation.
Notes
Natural numbers and whole numbers are not distinct enough from Integer to warrant a new type and are better addressed by constrained types:constraints.
