To ease reproducibility, the variable *RANDOM-STATE*
is
initialized to the same value on each invocation, so that
$
clisp -norc-x
'(RANDOM
1s0)'
will always print the same number.
If you want a new random state on each invocation, you can arrange for that by using init function:
$
clisp -norc-x
'(EXT:SAVEINITMEM
"foo" :init-function (LAMBDA
() (SETQ
*RANDOM-STATE*
(MAKE-RANDOM-STATE
T
))))'$
clisp -norc-M
foo.mem-x
'(RANDOM
1s0)'
or by placing (
into your RC file.SETQ
*RANDOM-STATE*
(MAKE-RANDOM-STATE
T
))
Function EXT:!
(
returns the
factorial of EXT:!
n
)n
, n
being a nonnegative INTEGER
.
Function EXT:EXQUO
. (
returns
the integer quotient EXT:EXQUO
x
y
)x/y
of two integers
x
,y
, and SIGNAL
s an ERROR
when the quotient is not
integer. (This is more efficient than /
.)
Function EXT:XGCD
. (
returns the values EXT:XGCD
x1
... xn
)l
, k1
, ..., kn
, where l
is the
greatest common divisor of the integers x1
, ..., xn
, and
k1
, ..., kn
are the integer coefficients such that
l
= (GCD
x1
...xn
) = (+ (*k1
x1
) ... (*kn
xn
))
Function EXT:MOD-EXPT
. (
is equivalent to EXT:MOD-EXPT
k
l
m
)(
except it is more efficient for very large arguments.MOD
(EXPT
k
l
) m
)
Function EXPT
. (
is not very precise if EXPT
base
exponent
)exponent
has a large
absolute value.
Function LOG
. (
LOG
number
base
)SIGNAL
s an ERROR
if
.base
= 1
Constant PI
. The value of PI
is a LONG-FLOAT
with the precision given
by (
. When this precision is changed, the value of EXT:LONG-FLOAT-DIGITS
)PI
is
automatically recomputed. Therefore PI
is not a constant variable.
Function UPGRADED-COMPLEX-PART-TYPE
. When the argument is not a recognizable subtype or REAL
,
UPGRADED-COMPLEX-PART-TYPE
SIGNAL
s an ERROR
, otherwise it
returns its argument (even though a COMPLEX
number in CLISP can
always have REALPART
and IMAGPART
of any type) because it allows
the most precise type inference.
Variable CUSTOM:*DEFAULT-FLOAT-FORMAT*
. When rational numbers are to be converted to floats (due to
FLOAT
, COERCE
, SQRT
or a transcendental function), the result
type is given by the variable CUSTOM:*DEFAULT-FLOAT-FORMAT*
.
Macro EXT:WITHOUT-FLOATING-POINT-UNDERFLOW
. The macro (
executes the
EXT:WITHOUT-FLOATING-POINT-UNDERFLOW
{form
}*)form
s, with errors of type FLOATING-POINT-UNDERFLOW
inhibited.
Floating point operations will silently return zero instead of
SIGNAL
ing an ERROR
of type FLOATING-POINT-UNDERFLOW
.
Condition FLOATING-POINT-INVALID-OPERATION
. This CONDITION
is never SIGNAL
ed by CLISP.
Condition FLOATING-POINT-INEXACT
. This CONDITION
is never SIGNAL
ed by CLISP.
FLOAT-RADIX
always returns 2.
(
coerces
FLOAT-DIGITS
number
digits
)number
(a REAL
) to a floating point number with at least
digits
mantissa digits. The following always evaluates to T
:
(>=
(FLOAT-DIGITS
(FLOAT-DIGITS
number
digits
))digits
)
Table 12.2. Fixnum limits
CPU type | 32-bit CPU | 64-bit CPU |
---|---|---|
MOST-POSITIVE-FIXNUM | 224-1 = 16777215 | 248-1 = 281474976710655 |
MOST-NEGATIVE-FIXNUM | -224 = -16777216 | -248 = -281474976710656 |
BIGNUM
s are limited in size. Their maximum size is
32*(216-2)=2097088
bits.
The largest representable BIGNUM
is therefore
22097088-1
.
Together with PI
, the other LONG-FLOAT
constants
are recomputed whenever (
is EXT:LONG-FLOAT-DIGITS
)SETF
ed.
They are not constant variables.
These notes document CLISP version 2.41 | Last modified: 2006-10-13 |