Qalculate / qalculate-qt

GNU General Public License v2.0
380 stars 42 forks source link

Implicit multiplication not working!? #89

Open COALROCK8642 opened 1 year ago

COALROCK8642 commented 1 year ago

Why is this not working? May be we need guide to settings.

image

hanna-kn commented 1 year ago

What is it that does not work as you expect?

The only odd thing I notice in the screenshot is that min decimals seems to be set to 10.

The interpretation of 1/2x is determined by "parsing mode" setting (under Parsing & Calculation in preferences).

COALROCK8642 commented 1 year ago

But what will I do if my expression is 2pi/2*4*root(2,2) I expect this to be 2*pi/8*root(2,2) and it comes ((2 × pi)/2) × 4 × root(2, 2)

image

COALROCK8642 commented 1 year ago

In reply to my previous comment, this works, 2pi/(2×4)root(2,2) But I rather have option to express values as expressions All numerator stuff '/' All denominator stuff Taken that we are expected to use () for any compound fractions.

image

hanna-kn commented 1 year ago

So, you want an option to always (both with implied multiplication and when using a multiplication sign) evaluate multiplication before division (i.e. multiplication having higher precedence)?

COALROCK8642 commented 1 year ago

Yes! Yes! Yes! Exact words. Within brackets (if any) all multiplications will have presedence and then divisions will happen.

hanna-kn commented 1 year ago

This would not be difficult to implement, but it seems a bit unusual. Is explicit multiplication performed before division anywhere else?

COALROCK8642 commented 1 year ago

This would not be difficult to implement, but it seems a bit unusual. Is explicit multiplication performed before division anywhere else?

But this is nesscary when people will solve compound fractions.

COALROCK8642 commented 1 year ago

for example, (x1*x2/y1*y2)/z1*z2 can be just written x1*x2/y1*y2//z1*z2 and will process like, ((x1*x2)/(y1*y2))/(z1*z2) and /,//,/// will scale according to compound fractions.

And so, another example, (x1*x2/y1*y2)/((z1*z2)/(w1*w2)) can be just written x1*x2/y1*y2//z1*z2/w1*w2 and will process like, ((x1*x2)/(y1*y2))/((z1*z2)/(w1*w2)) and /,//,/// will scale according to compound fractions.

hanna-kn commented 1 year ago

My question remains. Is this notation and order of operations used anywhere?

It seems safer to use parentheses instead, and it does remove the necessity of parentheses for expressions with addition or subtraction in the numerator or denominator (e.g. (x1+x2)/(y1+y2)).