basic maths operations implemented in CFFI