Go to the first, previous, next, last section, table of contents.


Arithmetic Functions

There are a number of functions which perform arithmetic operations on numbers, they take a varying number of integer objects as their arguments then return a new integer object as their result.

Note that none of these functions check for overflow.

Function: + number1 &rest numbers
This functions adds its arguments then returns their sum.

Function: - number1 &rest numbers
If this function is just given one argument (number1) that number is negated and returned. Otherwise each of numbers is subtracted from a running total starting with the value of number1.

(- 20)
    => -20

(- 20 10 5)
    => 5

Function: * number1 &rest numbers
This function multiplies its arguments then returns the result.

Function: / number1 &rest numbers
This function performs division, a running-total (initialised from number1 is successively divided by each of numbers then the result is returned.

(/ 100 2)
    => 50

(/ 200 2 5)
    => 20

Function: % dividend divisor
Returns the remainder from dividing dividend by divisor.

(mod 5 3)
    => 2

Function: 1+ number
This function returns the result of adding one to number.

(1+ 42)
    => 43

Function: 1- number
Returns number minus one.


Go to the first, previous, next, last section, table of contents.