Issue #3: add some math functions.