Warning: This is the manual of the legacy Guile 2.2 series. You may want to read the manual of the current stable series instead.
Next: Comparison, Previous: Number Syntax, Up: Numbers [Contents][Index]
Return #t
if n is an odd number, #f
otherwise.
Return #t
if n is an even number, #f
otherwise.
Return the quotient or remainder from n divided by d. The quotient is rounded towards zero, and the remainder will have the same sign as n. In all cases quotient and remainder satisfy n = q*d + r.
(remainder 13 4) ⇒ 1 (remainder -13 4) ⇒ -1
See also truncate-quotient
, truncate-remainder
and
related operations in Arithmetic.
Return the remainder from n divided by d, with the same sign as d.
(modulo 13 4) ⇒ 1 (modulo -13 4) ⇒ 3 (modulo 13 -4) ⇒ -3 (modulo -13 -4) ⇒ -1
See also floor-quotient
, floor-remainder
and
related operations in Arithmetic.
Return the greatest common divisor of all arguments. If called without arguments, 0 is returned.
The C function scm_gcd
always takes two arguments, while the
Scheme function can take an arbitrary number.
Return the least common multiple of the arguments. If called without arguments, 1 is returned.
The C function scm_lcm
always takes two arguments, while the
Scheme function can take an arbitrary number.
Return n raised to the integer exponent k, modulo m.
(modulo-expt 2 3 5) ⇒ 3
Return two exact non-negative integers s and r such that k = s^2 + r and s^2 <= k < (s + 1)^2. An error is raised if k is not an exact non-negative integer.
(exact-integer-sqrt 10) ⇒ 3 and 1
Next: Comparison, Previous: Number Syntax, Up: Numbers [Contents][Index]