Workaround for lack of isfinite() in Visual C++