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

fix: fix extended-algorithm accuracy problem #117

Merged
merged 3 commits into from
Apr 25, 2021
Merged

fix: fix extended-algorithm accuracy problem #117

merged 3 commits into from
Apr 25, 2021

Conversation

yuzhanglong
Copy link
Member

之前的 fix 虽然解决了间隔大小不一致的问题,但是对更小的小数值会出错(例如0.0001),原因是处理浮点数计算问题的算法不够严谨,在这里做出修正。

Copy link
Member

@pearmini pearmini left a comment

Choose a reason for hiding this comment

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

我暂时没有问题了

@hustcc
Copy link
Member

hustcc commented Apr 25, 2021

精度四则运算,参考 https://github.com/nefe/number-precision 做法。目前转整数再除的方法可能也能达到,但是感觉有点非主流了。

@hustcc hustcc self-requested a review April 25, 2021 03:40
@pearmini
Copy link
Member

pearmini commented Apr 25, 2021

精度四则运算,参考 https://github.com/nefe/number-precision 做法。目前转整数再除的方法可能也能达到,但是感觉有点非主流了。

https://github.com/nefe/number-precision/blob/master/src/index.ts#L70 好像也是这么做的?

@hustcc
Copy link
Member

hustcc commented Apr 25, 2021

精度四则运算,参考 https://github.com/nefe/number-precision 做法。目前转整数再除的方法可能也能达到,但是感觉有点非主流了。

https://github.com/nefe/number-precision/blob/master/src/index.ts#L70 好像也是这么做的?

还真是的~

@hustcc
Copy link
Member

hustcc commented Apr 25, 2021

image

判断小数稍微严谨了些。

@pearmini
Copy link
Member

image

判断小数稍微严谨了些。

对,通用性也要强一点

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

Successfully merging this pull request may close these issues.

3 participants