simple math functions in erlang