-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
We have:
$ root.exe -b -l
root [0] struct Content { double d = std::numeric_limits<double>::infinity(); }
root [1] Content c;
root [2] auto s = TBufferJSON::ToJSON(&c)
(TString &) "{
"_typename" : "Content",
"d" : 2e308
}"[44]
root [3] Content *p = nullptr;
root [4] TBufferJSON::FromJSON<Content>(p, s)
libc++abi: terminating due to uncaught exception of type nlohmann::detail::out_of_range: [json.exception.out_of_range.406] number overflow parsing '2e308'
Abort trap: 6
At as side note we also have:
root [0] struct Content { double d = std::numeric_limits<double>::infinity(); }
root [1] Content *p = nullptr;
root [2] TString s = "{ \"_typename\" : \"Content\", \"d\" : null }"
(TString &) "{ "_typename" : "Content", "d" : null }"[39]
root [3] TBufferJSON::FromJSON<Content>(p, s)
(bool) true
root [4] p->d
(double) nan
So null represent nan rather than infinity.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status