Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why do this use precision = 15 as default value for strip function? #49

Closed
R2h1 opened this issue Apr 6, 2022 · 1 comment
Closed

Comments

@R2h1
Copy link

R2h1 commented Apr 6, 2022

why do this use precision = 15 as default value for strip function?

@camsong
Copy link
Member

camsong commented Nov 24, 2022

It's based on experience. The precision of JS floating-point numbers is 16, and numbers with greater precision cannot be represented. Selecting a small precision can automatically filter out some 0001 and 0009 problems. I just chooses 15.
You may get more info from my blog camsong/blog#9

@camsong camsong closed this as completed Nov 24, 2022
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

No branches or pull requests

2 participants