Convert isNan/isInfinite into templates, add compile-time float path