top
About Buy News Guide Ideas
Get a phatIO device here!

Back to Table of Contents

Mathematics

The native data type in phatIO is a unsigned 16 bit integer. No overflow checking is done.

(+ a b)

Returns a + b.

(+= <variable reference> a)

Adds a to the variable reference and returns the result, for example:

(defvar i 3)
(keyboard "was: " i " is now: " (+= i 2) " and now: " i)

Will type:

was: 3 is now: 5 and now: 5

(- a b)

Returns a - b.

(* a b)

Returns a * b.

(/ a b)

Returns a / b.

(% a b)

Returns a modulo b.

(| a b)

Returns a | b - the bitwise or.

(& a b)

Returns a & b - the bitwise and

(<< a b)

Returns a << b, a shifted left b bits

(>> a b)

Returns a >> b, a shifted right b bits

@Contact  |   Legal & Privacy  |    RSS  |   Development Twitter  |   Official Twitter
© phatIO 2012, All Rights Reserved.