![]() | ![]() | ![]() | Declared Numerics | ![]() |
The :gbbopen-tools module contains a set of declared-numeric
and pseudo probability operators that provide convenient
shorthands for declaring ,
short-floatsingle-floatdouble-floatlong-floatpseudo-probabilityfixnumsingle-floatdouble-floatlong-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 | ||
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.
The GBBopen Project
![]() | ![]() | ![]() | Declared Numerics | ![]() |