mcollina / msgpack5

A msgpack v5 implementation for node.js, with extension points / msgpack.org[Node]
MIT License
493 stars 76 forks source link

implement better support for floats #71

Closed imnotjames closed 6 years ago

imnotjames commented 6 years ago

this change uses fround when available to make a better decision on if a number is a 32 or 64 bit floating point number. This means that we can more safely use floats in msgpack without losing precision.

In the case where Math.fround is not defined (I'M LOOKIN AT YOU, IE10), this code defaults to using a float64 so that we don't accidentally lose precision like we did with the previous implementation

mcollina commented 6 years ago

Good work! Would you like to help maintaining this library? You are probably using it more than myself at this point.