MathLib: Return inf.0 for NAN and INF calculations