Extra Math functions and unit tests