Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Exponent issue #19

Open
cjolif opened this issue Nov 20, 2018 · 6 comments
Open

Exponent issue #19

cjolif opened this issue Nov 20, 2018 · 6 comments

Comments

@cjolif
Copy link

cjolif commented Nov 20, 2018

Parsii, gives 3-6^2 = 39 where I would expect -33?

@jibanes
Copy link

jibanes commented Dec 31, 2018

confirmed

Parser.parse("a-b^2", scope);
a.setValue(3);
b.setValue(6);

produces -33

Parser.parse("3-6^2");

produces 39

Parser.parse("3-(6^2)");

produces -33

@subes
Copy link

subes commented Mar 5, 2019

I have fixed this issue in my fork. You can see what change is required here: invesdwin/invesdwin-util@152afa3

This should be easy to pull into parsii itself.

elmuerte pushed a commit to mpobjects/bdparsii that referenced this issue May 27, 2019
@Epaf-2019
Copy link

I still have this issue with parsii-4.0, even with the sources package.
How can I get the correct version of parsii ?
What is mpobjects/bdparsii ?

@Epaf-2019
Copy link

Is it normal that : "1+(-3^2)" still gives 10, instead of -8 ?
More simpler: -3^2 gives 9, instead of -9

@umajeric
Copy link

-3^2 = -3 * -3 ≠ -9

@Epaf-2019
Copy link

According to Wikipedia: "In written or printed mathematics, the expression −3^2 is interpreted to mean 0 − (3^2) = − 9".

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

No branches or pull requests

5 participants