JamesNK/Newtonsoft.Json — Issue #1: Serializing NaN results in non-JSON compliant text
Author: kg4lod
Created: 2012-02-23 05:14:40+00:00
State: open

When serializing numeric properties of classes that, for example, divide by zero, the result is NaN, breaking the JSON output.

{ "InvalidCalculatedProperty" : NaN }

I'd recommend switching to string type in this case:

{ "InvalidCalculatedProperty" : "NaN" }

...or, perhaps, throwing an exception.

Anything else, but the current output isn't valid.

Thank you for this amazing library. Keep up the great work. Cheers! -Jonathan