On this page:
+
-
/
*
=
<
>
pi
e
mod
abs
even?
odd?
sgn
inc
dec
exp
sin
cos
tan
int

3.8 Math

procedure

(+ x ...)  number?

  x : number?
Adds the given numbers left to right and returns the result. If only one argument is given, returns the argument. If no arguments are provided, returns 0.

procedure

(- x y ...+)  number?

  x : number?
  y : nuber?
(- x)  number?
  x : number?
Subtracts the given numbers left to right and returns the result. If only one argument is given, returns (- 0 x).

procedure

(/ x y ...+)  number?

  x : number?
  y : number?
(/ x)  number?
  x : number?
Divides the numbers from left to right and returns the result. If only one argument is given, returns (/ 1 x).

procedure

(* x ...)  number?

  x : number?
Multiplies the numbers given from left to right and returns the result. If no argument is given, returns one. If one argument is given, returns the argument.

procedure

(= x y ...)  boolean?

  x : number?
  y : number?
Returns True if all the numbers are numerically equal.

procedure

(< x y ...)  boolean?

  x : number?
  y : number?
Returns True if all arguments are greater than the one previous going right (ie, x < y < z, etc.)

procedure

(> x y ...)  boolean?

  x : number?
  y : number?
Returns True if all arguments are less than the one previous going right (ie, x > y > z, etc.)

value

pi : number?

A bound variable containing the 64-bit floating point value of pi.

value

e : number?

A bound variable containing the 64-bit floating point value of Euler’s number.

procedure

(mod x y)  number?

  x : number?
  y : number?
Returns the modulus of x divided by y.

procedure

(abs n)  number?

  n : number?
Returns the absolute value of n.

procedure

(even? n)  boolean?

  n : number?
Returns True if n is even.

procedure

(odd? n)  boolean?

  n : number?
Returns True if n is odd.

procedure

(sgn n)  number?

  n : number?
Returns -1 if n is negative, 0 if n is zero, and 1 if n is positive.

procedure

(inc n)  number?

  n : number?
Returns the value of (+ n 1).

procedure

(dec n)  number?

  n : number?
Returns the value of (- n 1).

procedure

(exp x)  number?

  x : number?
Returns the value of ex.

procedure

(sin x)  number?

  x : number?
Returns the sine of x as a floating point value.

procedure

(cos x)  number?

  x : number?
Returns the cosine of x as a floating point value.

procedure

(tan x)  number?

  x : number?
Returns the tangent of x as a floating point value.

procedure

(int x)  number?

  x : number?
Returns the value of x, rounded to a whole number, rounded down.