jan tolenaar / kiezellisp / index-of-everything

Name

math:rem

Usage

builtin-function

Syntax

(math:rem number1 number2)

Description

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

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

See also

% math:mod math:truncate