Some handy dandy math functions