Skip to content

Conversation

imnotjames
Copy link
Contributor

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

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
Copy link
Owner

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcollina mcollina merged commit 52e8753 into mcollina:master May 20, 2018
@mcollina
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants