requires #include <math.h> for Windows