top
About Buy News Guide Ideas
The phatIO project has finished, and I'm no longer selling ready made boards - but you're welcome to look around - send any questions to the email below

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) [plus]
Returns a + b.

##(+= <variable reference> a)[plusequal] 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)[subtract] Returns a - b.

##(* a b)[multiply] Returns a * b.

##(/ a b)[divide] Returns a / b.

##(% a b)[modulo] Returns a modulo b.

##(| a b)[bitwiseor] Returns a | b - the bitwise or.

##(& a b)[bitwiseand] Returns a & b - the bitwise and

##(<< a b)[leftshift] Returns a << b, a shifted left b bits

##(>> a b)[rightshift] Returns a >> b, a shifted right b bits

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