Closed Strasser-Pablo closed 8 years ago
@Strasser-Pablo This will be an invalid JSON conversion, as there is no NaN nor Infinity in the JSON specification. See this. What would you do if one wants to convert "NaN" as a string? Although I understand that JSON should bring a better floating point number support, I won't accept this workaround to break the JSON specification.
Perhaps a better approach is to follow Python's approach, where one can specify an option flag to enable/disable Infinity/NaN support in conversion.
Yes, I believe adding a flag to support NaN and Infinity would be a good Idea. I will have a look at it. The NaN conversion worked well for my use case. Thanks for the answer.
This support is added by converting NaN value to NaN string. Note that when converting back to matlab NaN string will be considered as NaN number.