Solves issue 3204: Alternative inclusion of <math.h> or <cmath> which generate an error for isnan

This patch removes all dependencies of <math.h> from *.cpp and *.hpp files and replace them with <cmath>. Source files that used functions from <math.h> or referenced .hpp files that included <math.h> were changed so that such function calls are now under the std:: scope.

Notice that no changes were made to *.c or *.h files.