Special treatment for NaN and Infinity as per RFC-4627.

> Numeric values that cannot be represented as sequences of digits
> (such as Infinity and NaN) are not permitted.

http://tools.ietf.org/html/rfc4627#page-3