Skip to content

arithmetic

TurtleKitty edited this page May 12, 2019 · 2 revisions

+

Addition.

(+ 1 2 3 4 5) ; 15

-

Subtraction.

(- 7 5 2) ; 0

*

Multiplication.

(* 2 3) ; 6

/

Division.

(/ 15 3)    ; 5
(/ 15 2.0)  ; 7.5

div

Integer division.

(div 15 3)     ; 5
(div 15 2.0)   ; 7.0
(div 15 2)     ; 7
(div -15 2)    ; -7

rem

Integer remainder.

(rem 15 2)  ; 1
(rem -15 2) ; -1

mod

Modulo.

(mod 15 2)  ; 1
(mod -15 2) ; 1
Clone this wiki locally