Numbers

## Numbers

 () C + (x| y| => ) G returns the sum of its arguments. - (x| y| => ) G returns the difference of its arguments. * (x| y| => ) G returns the product of its arguments. / (x| y| => ) G returns the quotient of its arguments. round (x| => ) G returns closest integer to x. If x is exactly between two integers then the implementation is free to return either integer. round-to (x| n| => ) G returns x to closest flo n digits precision. floor (x| => (tup rem|)) G returns an integer by truncating x towards negative infinity. ceil (x| => (tup rem|)) G returns an integer by truncating x towards positive infinity. trunc (x| => (tup rem|)) G returns an integer by truncating x towards zero. mod (x| y| => ) G returns the remainder after taking the floor of the quotient of x and y. div (x| y| => ) G returns the trunc of the quotient of x and y. rem (x| y| => ) G returns remainder after dividing x by y. pow (x| e| => ) G returns x raised to the e power. exp (x| => ) G == (pow \$e x) sqrt (x| => ) G returns the square root of x. pos? (x| => ) G == (> x 0) zero? (x| => ) G == (= x 0) neg? (x| => ) G == (< x 0) neg (x| => ) G == (- 0 x) abs (x| => ) G == (if (neg? x) (neg x) x) num-to-str-base (x| b| => ) G returns string representation of x in base b. num-to-str (x| => ) G equiv (num-to-str-base x 10) str-to-num (x| => ) G returns closest number corresponding to string x. INCF (INCF ,name) S == (SET ,name (+ ,name 1)) (INCF (,name ,@rest)) S == (SET (,name ,@rest) (+ (,name ,@rest) 1)) DECF (DECF ,name) S == (SET ,name (+ ,name 1)) (DECF (,name ,@rest)) S == (SET (,name ,@rest) (+ (,name ,@rest) 1)) \$e I \$pi I sqrt (x| => ) G log (x| => ) G logn (x| b| => ) G sin (x| => ) G cos (x| => ) G tan (x| => ) G asin (x| => ) G acos (x| => ) G atan (x| => ) G atan2 (y| x| => ) G sinh (x| => ) G cosh (x| => ) G tanh (x| => ) G

### Integers

GOO currently represents integers as 30 bit fixnums.
 () C | (x| y| => ) G returns the logical inclusive or of its arguments. & (x| y| => ) G returns the logical and or of its arguments. ^ ((x| y| => )) G == (| (& x (~ y)) (& (~ x) y)) ~ (x| => ) G returns the logical complement of its argument. bit? (x| n| => ) G returns true iff nth bit is 1. even? (x| => ) G odd? (x| => ) G gcd (x| y| => ) G greatest common denominator. lcm (x| y| => ) G least common multiple. << (x| n| => ) G returns n bit shift left of x. >> (x| n| => ) G returns signed n bit shift right of x. >>> (x| n| => ) G returns unsigned n bit shift right of x.

### Floats

GOO currently only supports single-precision floating point numbers.
 () C flo-bits (x| => ) G returns bit representation as an integer.

 Numbers