Detect non-finite floats and output them as "null" as per the spec.