How to deal with Infinity in serialization?
See original GitHub issueHi, The reviver option in JSON.parse is very helpful. But, I am not sure how to deal with Infinity. At present, I am loosing its information. Here is an example:
var a="[1,2i,1/0]";
var b=math.evaluate(a);
var c = JSON.stringify(b);
var d = JSON.parse(c, math.json.reviver);
By the time I reach last step, the variable d
is losing its Infinity value.
How can I fix this problem?
Thank you for your time.
_Originally posted by @skgadi in https://github.com/josdejong/mathjs/issues/27#issuecomment-621639696_
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
System.Text.Json: Handling Infinity values - Stack Overflow
From what I can tell, this is the appropriate way to handle double "Infinity" values when using NewtonsoftJson, ...
Read more >Infinity in JavaScript - Dmitri Pavlutin
Infinity in JavaScript is a special number bigger than any finite number. ... When serialized with JSON.stringify() , the infinite number ...
Read more >Jackson - Bidirectional Relationships - Baeldung
First, we'll discuss the Jackson JSON infinite recursion problem. Then we'll see how to serialize entities with bidirectional relationships.
Read more >JSON serializer will write out Inifinity but JSON.parse fails to ...
This program demonstrates the problem. TestMongoInfinity.java. public class TestMongoInfinity {. public static void test ...
Read more >Understand Serialization and Deserialization in Java
At Board Infinity we have authors leading in their profession sharing their insights, ideas and inspiration. Here influential thinkers, creators ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed now in
v6.6.5
I created a fix in 28b7a02f01c6f4d4512c7f967ff9671e732d1220 (not yet published)