Custom implementations of isnan/isinf as it's just a mess portability-wise..