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

[Bug] Formula calculation accuracy problem =1/3*3 #1712

Closed
2 tasks done
Dushusir opened this issue Mar 27, 2024 · 3 comments · Fixed by #2371
Closed
2 tasks done

[Bug] Formula calculation accuracy problem =1/3*3 #1712

Dushusir opened this issue Mar 27, 2024 · 3 comments · Fixed by #2371
Assignees
Labels
bug Something isn't working scope:formula

Comments

@Dushusir
Copy link
Member

Dushusir commented Mar 27, 2024

在您提交此问题之前,您是否检查了以下内容?

  • 这真的是个问题吗?
  • 我已经在 Github Issues 中搜索过了,但没有找到类似的问题。

受影响的包和版本

dev

复现链接

输入公式 =1/3*3

预期行为

1

实际行为

0.9999999999999999

运行环境

No response

系统信息

No response

@Dushusir Dushusir added the bug Something isn't working label Mar 27, 2024
@univer-bot univer-bot bot changed the title [Bug] 公式计算精度问题 =1/3*3 [Bug] Formula calculation accuracy problem =1/3*3 Mar 27, 2024
@univer-bot
Copy link

univer-bot bot commented Mar 27, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

Origin Title: [Bug] 公式计算精度问题 =1/3*3

Title: [Bug] Formula calculation accuracy problem =1/3*3


Before you submitted this question, did you check the following?

  • Is this really a problem?
  • I've searched Github Issues but haven't found any similar issues.

Affected packages and versions

dev

Recurrence link

Enter the formula =1/3*3

Expected behavior

1

Actual behavior

0.99999999999999999

Running environment

No response

system message

No response

@Dushusir
Copy link
Member Author

Dushusir commented Mar 27, 2024

发现是 Big.js 问题,方案是 去除 Big.js,最后计算出结果做精度处理,如果超出15位再取前十五位

@univer-bot
Copy link

univer-bot bot commented Mar 27, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

It was found that it was a Big.js problem. The solution was to remove Big.js, and finally calculate the result for precision processing. If it exceeds 15 digits, then take the first fifteen digits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scope:formula
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants