Improve replacement math functions for Visual C++.
Merge pull request #2537 from chasonr/math-functions

Improve replacement math functions for Visual C++.