Declared Numerics |
The :gbbopen-tools
module contains a set of declared-numeric
and pseudo probability operators that provide convenient
shorthands for declaring
,
short-float
single-float
double-float
long-float
pseudo-probability
fixnum
single-float
double-float
long-float
The names of the declared-numeric and pseudo-probability operators include these “type-indicator” characters:
Characters | Declared Type | ||
& | fixnum | ||
$& | short-float | ||
$ | single-float | ||
$$ | double-float | ||
$$$ | long-float | ||
% | pseudo-probability | ||
Thus, the declared-numeric +
operators are:
+& | fixnum addition | ||
+$& | short-float addition | ||
+$ | single-float addition | ||
+$$ | double-float addition | ||
+$$$ | long-float addition | ||
+% | pseudo-probability addition | ||
Most Common Lisp implementations map double-float numbers to the 64-bit
IEEE
754 double
format and single-float numbers to the 32-bit IEEE
754 single
format. The four types of floating-point declared numeric operators
(short-float
single-float
double-float
long-float
float
representations. The features :has-short-float
:has-single-float
:has-double-float
:has-long-float
float
representation. (The feature
:has-single-float
The following two features related to fixnum
capabilities are defined
when appropriate: :fixnum-size-below-29
:fixnum-size-supports-unsigned-byte-32
Some examples of declared-numeric operators include:
(& x) ==> (the fixnum x) (+& x y) ==> (the fixnum (+ (the fixnum x) (the fixnum y)) (>$ a b) ==> (> (the single-float a) (the single-float b)) (minusp$$ value) ==> (minusp (the double-float value)) (truncate& x y)) ==> (the (values fixnum fixnum) (truncate (& x) (& y)))The complete set of operators for each declared numeric type are listed in the following sections. (Pseudo probability operators are listed in the Pseudo Probabilities section of the manual.)
Declared Numerics |