:

## A hierarchy of Maple's numerical types

I've created a Maple help page, saved in a small hdb file, that describes the hierarchy of Maple's numerical types.  Insert it into the path assigned to ?libname.  Access the help page with ?numer-hier. To make it compact, I took some liberties with the notation.  Here is what it looks like

```Hierarchy of Numerical Types
- The following table describes the partial ordering (Definition[partialorder]) of Maple
numerical types. Each type is defined in terms of its minimal cover. A type on the left side of
the definition operator (::=) is defined by the expression on the right side. Each type is
defined by previously defined types (those preceding it in the table), though some definitions
are recursive.

- The vertical bar (|) is the or operator. The ampersand (&) is the and operator.

- The symbol x is the expression being tested; it is used to indicate a non-type restriction or a
restriction on a transformation of the expression. For example, Re(x) > 0 & Im(x)::integer is
true when the real part of x is positive and the imaginary part is of type integer.

- The term d stands for a subtype, that is, a restriction of the domain of the base type.

- The point (.) stands for any appropriate expression; for example, Float( . , infinity)
corresponds to a float with any valid mantissa and an exponent of type infinity.

- Single forward quotes around a field is used as a shorthand for the identical type. For
example, 'infinity' is equivalent to identical(infinity), which is not the same as the
infinity type.

- The fields Integer, Fraction, and Float (SFloat) refer to constructors for the integer,
fraction, and float elements, respectively.

integer               ::= Integer( . )
integer[1|2|4|8]      ::= integer & representable by (1|2|4|8)-bytes (signed)
integer[i1..i2]       ::= integer & i1 <= x <= i2 (i1 and i2 are integers)
posint                ::= integer & (x > 0)
nonnegint             ::= integer & (x >= 0)
negint                ::= integer & (x < 0)
nonposint             ::= integer & (x <= 0)

even                  ::= integer & irem(x,2)=0
odd                   ::= integer & Not(even)

fraction              ::= Fraction( . , . )
rational              ::= integer | fraction
extended_rational     ::= rational
| identical(infinity,-infinity,undefined)

float[]               ::= <hardware float>
float[8]              ::= <hardware float>
sfloat                ::= Float( . , . ) | SFloat( . , . )
float                 ::= sfloat | float[] | float[8]

numeric               ::= rational
| Float(integer)
| Float(integer, integer)
infinity              ::= identical(infinity,-infinity)
| Float( . , 'infinity' )
| (Re|Im)(x)::infinity & (Re&Im)(x)::(infinity|numeric)
undefined             ::= 'undefined'
| Float( integer , 'undefined' )
| (Re|Im)(x)::undefined & (Re&Im)(x)::(undefined|numeric)
extended_numeric      ::= numeric
| identical(infinity, -infinity)
| Float( integer , 'infinity' )
| undefined

nonnegative           ::= extended_numeric & (x >= 0)
positive              ::= extended_numeric & (x > 0)
nonpositive           ::= extended_numeric & (x <= 0)
negative              ::= extended_numeric & (x < 0)
negzero               ::= '-0.0'
poszero               ::= '+0.0' | '0'

realcons              ::= evalf(x)::{float | identical(infinity,-infinity)}
complex(d)            ::= (Re & Im)(x)::d
complex               ::= complex(numeric & realcons)
finite                ::= complex(numeric)
complexcons           ::= evalf(x)::complex
nonreal               ::= complex(extended_numeric)
& Not(extended_numeric)
nonreal(d)            ::= nonreal & (Re&Im)(x)::d
imaginary(d)          ::= complex(d) & (Re(x) = 0)
imaginary             ::= imaginary(extended_numeric)

embedded_real         ::= complex(extended_numeric) & (Im(x) = 0)
embedded_real(d)      ::= embedded_real & Re(x)::d
embedded_imaginary    ::= nonreal & (Re(x) = 0)
embedded_imaginary(d) ::= embedded_imaginary & Im(x)::d
embedded_axis         ::= embedded_real | embedded_imaginary
embedded_axis(d)      ::= (embedded_real | embedded_imaginary)(d)

algext(d)             ::= RootOf(polynom(d, . ))
algext                ::= algext(anything)
algnum                ::= rational
| RootOf(polynom(algnum))
| algnum+algnum
| algnum*algnum
| algnum/algnum
algnumext             ::= algnum & RootOf
radnum                ::= 'I'
| rational
| radnum+radnum
| radnum*radnum
| radnum^rational

cx_infinity           ::= nonreal & (Re&Im)(x)::infinity
real_infinity         ::= infinity & extended_numeric
pos_infinity          ::= infinity & positive
neg_infinity          ::= infinity & negative
SymbolicInfinity      ::= infinity | infinity * anything

See Also
anything, evalf, Float, Fraction, Im, Integer, Not, Re, type

```

﻿