math functions

based on aura