improve number/sign behavior when value is NaN

after merging PR #36 I realized we should also check if value `isNaN`.