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

Formula calculation error when we use units along with the power(^) #29

Open
Nits7029 opened this issue Jan 19, 2023 · 1 comment
Open

Comments

@Nits7029
Copy link

Let me explain here
I am using this type of value for the formula.

Screenshot 2023-01-19 at 3 28 15 PM

and it shows output like this

Screenshot 2023-01-19 at 3 28 33 PM

And its shows the wrong answer here.
if I want to get the correct answer. I have to write an equation like this. so how can I calculate power(^) for variables with unit?

Screenshot 2023-01-19 at 3 25 58 PM

And it shows output like this

Screenshot 2023-01-19 at 3 29 13 PM

that's the correct answer.

So, in the first case, the formula variable with the unit can't get calculated correctly with power.
and second case it is correct but I can't write a formula like this in my case.

@kgram
Copy link
Owner

kgram commented Jan 19, 2023

@Nits7029 Hm, I think I disagree about what is correct here. Would you expect (2m)^2 to equal 4m or 4m^2? I would definitely argue for the latter, since it should be equivalent to 2m * 2m. Exponentiation affects units as well. I think you'd find a lot of confusing behavior with the other interpretation, I can come up with a lot of weird interactions with units and variables if that was the case.

If it's mostly a matter of how the equation looks, you could omit the parentheses around the exponents and around the fractions, because of the grouping enforced by order of operations:

0.8*(12^0.85N)/mm^2*(12^0N)/mm^2

Screenshot 2023-01-19 at 16 14 53

Note that the parentheses around the numerators of the fractions are automatically hidden in the rendered equation, since they are only necessary in the text-version. The same thing would happen with parentheses in the denominators.

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