Next: Auxiliary Functions, Previous: Revised Formatting, Up: Enhanced Number Types [Contents][Index]
If GMP is available, some number theoretic functions are in effect. Most of which accept, unlike in number theory, all kinds of numbers. In that case coercion to the target range (mostly integer) takes place.
Return nil
if number is known to be composite,
return t
if number is definitely prime and
return 'probably-prime
if number seems to be
prime but it is not certain.
If optional argument certainty-threshold is non-nil
,
it should be a natural number to indicate how many probabilistic
primality tests must be passed in order to have certainty about the
primality of number.
The default is 8.
Return the next prime number greater than number.
Return the greatest common divisor of the arguments.
Return the least common multiple of the arguments.
Return the factorial of number.
Return the binomial coefficient, n over k.
Return the numberth Fibonacci number.
To compute both, the numberth and (number-1)th
Fibonacci number use fibonacci2
instead.
Return a cons with the numberth and (number-1)th Fibonacci number. To compute a series of Fibonacci numbers starting at index number, use this function and recursively compute the rest.
Return the numberth Lucas number.
To compute both, the numberth and (number-1)th
Lucas number use lucas2
instead.
Return a cons with the numberth and (number-1)th Lucas number. To compute a series of Lucas numbers starting at index number, use this function and recursively compute the rest.
Return t
if number is divisible by d,
nil
otherwise.
Return t
if number is congruent to c
modulo m, nil
otherwise.
Return t
if number is a perfect power, nil
otherwise.
An integer number is said to be a perfect power if there
exist integers, a and b, such that
‘a^b = number’.
Return t
if number is a perfect square, nil
otherwise.
An integer number is said to be a perfect square if there
exists an integer b such that
‘b^2 = number’.
Return a cons with the integral square root of number in the car and the remainder in the cdr. An integral square root is a number b and a remainder c such that ‘b*b + c = number’.
Return the canonical norm of number.
Return the (canonical) conjugate of number. If number is a comparable, just return number.
Return t
if number is a zero-divisor, nil
otherwise.
number is said to be a zero-divisor, if there exists another
non-zero number b, such that
‘number * b = 0’
Return t
if number is a unit, nil
otherwise.
number is said to be a unit, if there exists another number
b (the inverse of number), such that
‘number * b = 1’
Next: Auxiliary Functions, Previous: Revised Formatting, Up: Enhanced Number Types [Contents][Index]