[erlang-questions] BSON parsing?
Richard A. O'Keefe
Fri May 16 12:56:57 CEST 2014
On 16/05/2014, at 8:59 PM, Thomas Lindgren wrote:
> Those who need to store or pass around NaNs and infinities today can hold their noses and keep the raw floats as binaries. Hardly ideal, but it gets the job done.
For "storing or passing around" floating point values, you can keep
them *all* as binaries.
The problem is *computation*.
IEEE arithmetic is weird, but it is weird for good reason.
Admittedly JSON doesn't provide any official way to notate
±Infinity, but then JSON has very little in the way of semantics
for numbers anyway. Someone wanting to send Infinity might well
send 1.0e400, and they'd be surprised and dismayed to get an
exception instead of an Infinity.
More information about the erlang-questions