![]() | ![]() | ![]() | Declared Numerics | ![]() |
The :gbbopen-tools module contains a set of declared-numeric
and pseudo probability operators that provide convenient
shorthands for declaring fixnum, short-float,
single-float, double-float, long-float, and
pseudo-probability numeric operations. If the feature
:full-safety is present at compile time, these
operators do not make their fixnum, single-float,
double-float, and long-float declarations.
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 | ||
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.
Notes
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. Digitool's Macintosh Common
Lisp maps both double-float and
single-float types to the 64-bit IEEE
754
double format (only the short-float type maps to the
IEEE
754
single format).
The GBBopen Project
![]() | ![]() | ![]() | Declared Numerics | ![]() |