jan tolenaar / kiezellisp / index-of-everything

Name

math:mod

Usage

builtin-function

Syntax

(math:mod a b)

Description

Returns the remainder of the division of two numbers, i. e. the value of (- a (* (math:floor (/ a b)) b)).

make-html > (math:mod 7 3)
it: 1
make-html > (math:mod -7 3)
it: 2
make-html > (math:mod 7 -3)
it: -2
make-html > (math:mod -7 -3)
it: -1

See also

math:floor math:rem