isnan and isinf causing issues when compiling on some systems