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

feat(formula): add some engineering functions #3070

Merged
merged 8 commits into from
Aug 24, 2024

Conversation

wpxp123456
Copy link
Contributor

close #3040

Pull Request Checklist

  • Related tickets or issues have been linked in the PR description (or missing issue).
  • Naming convention is followed (do please check it especially when you created new plugins, commands and resources).
  • Unit tests have been added for the changes (if applicable).
  • Breaking changes have been documented (or no breaking changes introduced in this PR).

@wpxp123456 wpxp123456 added the qa:untested This PR is ready to be tested label Aug 15, 2024
Copy link

codecov bot commented Aug 15, 2024

Codecov Report

Attention: Patch coverage is 98.49946% with 14 lines in your changes missing coverage. Please review.

Project coverage is 28.52%. Comparing base (9e53c79) to head (841cbbb).
Report is 2 commits behind head on dev.

Files Patch % Lines
...ormula/src/engine/value-object/primitive-object.ts 82.60% 8 Missing ⚠️
packages/engine-formula/src/basics/complex.ts 98.26% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3070      +/-   ##
==========================================
+ Coverage   27.62%   28.52%   +0.90%     
==========================================
  Files        1995     2022      +27     
  Lines      105869   106763     +894     
  Branches    22837    23057     +220     
==========================================
+ Hits        29242    30453    +1211     
+ Misses      76627    76310     -317     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Aug 15, 2024

View Deployment

📑 Examples 📚 Storybook
🔗 Preview link 🔗 Preview link

@@ -422,3 +428,416 @@ export function erf(x: number): number {

return isneg ? res - 1 : 1 - res;
};

export class Complex {
Copy link
Member

Choose a reason for hiding this comment

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

This class deserve a complex.ts file of its own.

@@ -65,6 +65,8 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"big.js": "^6.2.1",
Copy link
Member

Choose a reason for hiding this comment

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

Please remove this if is not in your codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@oumomomo
Copy link

IMARGUMENT函数
单元格内输入=IMARGUMENT(H18+“1”),删除H18行,错误码不对
image

@univer-bot
Copy link

univer-bot bot commented Aug 20, 2024

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

IMARGUMENT function
Enter =IMARGUMENT(H18+"1") in the cell and delete row H18. The error code is incorrect.
image

@oumomomo
Copy link

imexp函数
输入=IMEXP(""),计算结果不一致
image

@univer-bot
Copy link

univer-bot bot commented Aug 21, 2024

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

imexp function
Enter =IMEXP(""), the calculation results are inconsistent
image

@oumomomo
Copy link

oumomomo commented Aug 21, 2024

IMLOG2函数

1、
单元格内输入=IMLOG2(-1)/=IMLOG2(0-1),计算结果不对
image

2、
单元格输入=IMLOG2(-11111111111)/=IMLOG2(-1+-3),计算结果少了
image
image

@univer-bot
Copy link

univer-bot bot commented Aug 21, 2024

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

IMLOG2 function

Enter =IMLOG2(-1)/=IMLOG2(0-1) in the cell, and the calculation result is incorrect.
image

Cell input =IMLOG2(-11111111111)/=IMLOG2(-1+-3), the calculation result is less
image
image

@oumomomo
Copy link

oumomomo commented Aug 21, 2024

IMPOWER函数

1、
单元格内输入=IMPOWER("2+3i", 895)/=IMPOWER("2+3i","25i"),错误码展示成了文本
image
image

@univer-bot
Copy link

univer-bot bot commented Aug 21, 2024

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

IMPOWER function

Enter =IMPOWER("2+3i", 895)/=IMPOWER("2+3i", "25i") in the cell, and the error code will be displayed as text
image
image

@oumomomo
Copy link

oumomomo commented Aug 21, 2024

IMPRODUCT函数
1、
单元格内输入=IMPRODUCT("0+1i"),计算结果错误
image

2、
单元格内输入=IMPRODUCT("1i+0.25")/=IMPRODUCT("99999988888i-9856"),excel展示为错误码
image
image

3、
单元格内输入=IMPRODUCT("")展示为空,excel展示为错误码
image

4、
单元格内输入=IMPRODUCT("1-12i","0.5-12j"),结果展示错误
image

5、
单元格内输入=IMPRODUCT("9i-测试哦 "),结果展示错误
image

@univer-bot
Copy link

univer-bot bot commented Aug 21, 2024

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

IMPRODUCT function
1.
Enter =IMPRODUCT("0+1i") in the cell, the calculation result is wrong
image

Enter =IMPRODUCT("1i+0.25")/=IMPRODUCT("99999988888i-9856") in the cell, and excel will display it as an error code
image
image

The input =IMPRODUCT("") in the cell is displayed as empty, and excel displays an error code.
image

Enter =IMPRODUCT("1-12i","0.5-12j") in the cell, and the result displays an error
image

Enter =IMPRODUCT("9i-Test ") in the cell, and the result displays an error
image

@oumomomo
Copy link

oumomomo commented Aug 21, 2024

IMSEC函数
单元格内输入=IMSEC("")/=IMSECH("")/=IMSINH(""),计算结果有误
image
image

@univer-bot
Copy link

univer-bot bot commented Aug 21, 2024

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

IMSEC function
Enter =IMSEC("")/=IMSECH("")/=IMSINH("") in the cell, and the calculation result is incorrect.
image
image

@oumomomo
Copy link

oumomomo commented Aug 21, 2024

IMSINH函数
1、
输入=IMSINH(D1-D2),D1=25698432,D2=-1,计算结果展示为空,且修改单元格内容计算结果不会更新
image

2、
输入=IMSECH(A1-"0.1"),A1=325,计算结果展示错误
image

3、
输入=IMSINH("0.00000002"),计算结果展示错误
image

@univer-bot
Copy link

univer-bot bot commented Aug 21, 2024

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

IMSINH function
1.
Input =IMSINH(D1-D2), D1=25698432, D2=-1, the calculation result is displayed as empty, and the calculation result will not be updated if the cell content is modified.
image

Input=IMSECH(A1-"0.1"), A1=325, the calculation result displays an error
image

Input =IMSINH("0.00000002"), the calculation result displays an error
image

@wpxp123456 wpxp123456 force-pushed the feat/add-engineering-func branch 4 times, most recently from f5aea86 to 5916fd9 Compare August 22, 2024 12:54
@oumomomo
Copy link

oumomomo commented Aug 23, 2024

该评论以下的问题均未修复

@univer-bot
Copy link

univer-bot bot commented Aug 23, 2024

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

None of the issues below this comment have been fixed

@oumomomo
Copy link

oumomomo commented Aug 23, 2024

IMSQRT函数
1、
单元格输入=IMSQRT("-i"),计算结果展示为了+号
image

2、
单元格内输入=IMSQRT("-0.023")/=IMSQRT("-0.4")/=IMSQRT("-1"),计算结果不对
image

3、
单元格内输入=IMSQRT("9.2568"-C13),C13=1 计算结果不对
image

4、
单元格内输入=IMSQRT(C19-C20),C19为空,C20=1 计算结果不对
image

5、
单元格内输入=IMSQRT(G33-G34),G33=-1,G34=2,计算结果不对
image

@univer-bot
Copy link

univer-bot bot commented Aug 23, 2024

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

IMSQRT function
1.
Cell input =IMSQRT("-i"), the calculation result is displayed as a + sign
image

Enter =IMSQRT("-0.023")/=IMSQRT("-0.4")/=IMSQRT("-1") in the cell, and the calculation result is incorrect.
image

Enter =IMSQRT("9.2568"-C13) in the cell, C13=1, the calculation result is incorrect
image

Enter =IMSQRT(C19-C20) in the cell, C19 is empty, C20=1, the calculation result is incorrect
image

Enter =IMSQRT(G33-G34), G33=-1, G34=2 in the cell, and the calculation result is incorrect.
image

@oumomomo
Copy link

IMSUM函数

1、单元格内输入=IMSUM("3+4i","5-3i")1,预期应该报错
image

@univer-bot
Copy link

univer-bot bot commented Aug 23, 2024

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

IMSUM function

  1. Enter =IMSUM("3+4i","5-3i")1 in the cell. It is expected that an error will be reported.
    image

@oumomomo
Copy link

IMTAN函数

1、在单元格内输入=IMTAN(E19+E20:E21),计算不出结果
image

@univer-bot
Copy link

univer-bot bot commented Aug 23, 2024

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

IMTAN function

  1. Enter =IMTAN(E19+E20:E21) in the cell, but the result cannot be calculated.
    image

@oumomomo oumomomo added qa:rejected and removed qa:untested This PR is ready to be tested labels Aug 24, 2024
@wpxp123456 wpxp123456 force-pushed the feat/add-engineering-func branch from 0487bae to 0dc3c67 Compare August 24, 2024 06:17
@oumomomo oumomomo added the qa:verified This PR has already by verified by a QA and is considered good enough to be merge label Aug 24, 2024
@univer-bot univer-bot bot removed the qa:rejected label Aug 24, 2024
@wpxp123456 wpxp123456 requested a review from wzhudev August 24, 2024 06:56
Copy link
Member

@wzhudev wzhudev left a comment

Choose a reason for hiding this comment

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

LGTM

@wpxp123456 wpxp123456 merged commit dbe1dab into dev Aug 24, 2024
9 checks passed
@wpxp123456 wpxp123456 deleted the feat/add-engineering-func branch August 24, 2024 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qa:verified This PR has already by verified by a QA and is considered good enough to be merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] More Engineering Formulas
4 participants