Added unit tests for new misc_math functions.