(fix) check isNaN
(fix) infinity
(fix) return NaN instead of null