
x=-9^0.5 hasn't to be handeled like x=0-9^0.5
You have to use paranthesis to make clear what really is meant:
x=-9^0.5 = i*3
or
x=-(9^0.5)=-3
Sadly enough, this is very trueLord wrote:I think that math rules have been "bowed" by programmers of math parser.![]()
Only someone who doesn't have sufficient knowledge in this field can write something like that.said wrote:Sadly enough, this is very trueLord wrote:I think that math rules have been "bowed" by programmers of math parser.![]()
Maybe it's new to you, but there are actually operator precedence rules in mathematics. That's what I was talking about all the time here. Read this, please. If you can't understand it, feel free to read a good textbook of your choice, or ask a math teacher.said wrote:One cannot accurately talk about ‘math rules’ here … (these are operator precedence rules not math rules)
said wrote:and it is all about conventions, by definition a convention is never right or wrong and anyone is free to use whatever convention he finds suitable.
Interesting, you know what the "common" interpretation of this expression is?said wrote:and yes the common math interpretation of
-9^0.5 is i*3 not -3
On the other hand you can make "^" do anything you want it to by judicious use of ()!Lord wrote:I think, it was a wise choice by Fred not to implement "^" instead of Pow().
With Pow() you have to know what is meant and what you have to do when you want to evaluate -9^0.5.
Thank you Fred!
I am very confident about every single word I wrote … there is nothing new in this subject, the first works on this started back in 1550! Anyone can consult a good math text book or check with some math profLittle John wrote:Only someone who doesn't have sufficient knowledge in this field can write something like that.said wrote:Sadly enough, this is very trueLord wrote:I think that math rules have been "bowed" by programmers of math parser.![]()
Maybe it's new to you, but there are actually operator precedence rules in mathematics. That's what I was talking about all the time here. Read this, please. If you can't understand it, feel free to read a good textbook of your choice, or ask a math teacher.said wrote:One cannot accurately talk about ‘math rules’ here … (these are operator precedence rules not math rules)
said wrote:and it is all about conventions, by definition a convention is never right or wrong and anyone is free to use whatever convention he finds suitable.
Oh well, tell your math teacher that you find the convention "2+2 = 5" suitable ...
Interesting, you know what the "common" interpretation of this expression is?said wrote:and yes the common math interpretation of
-9^0.5 is i*3 not -3
Did you perform a survey in a representative sample, or what![]()
![]()
I asked all mathematicians that I know, and in this group, the "common interpretation" is that
-9^0.5 = -(9^0.5) = -3
So once again: My parser works according to the established math rules, regardless whether any layman does know them or not.
Of course, everyone else is free to write her/his own parser that does whatever s/he wants.
So you are still missing the point, and didn't understand what I wrote in this thread.I am very confident about every single word I wrote …
Of course, this is "obvious" to you.LJ, obviously your knowledge in math is very basic
Yes, you have demonstrated this.there is no point in extending this discussion
So you will stop attacking the work by other people that you do not understand? Fine.bye
Yep, just like we can do with the already existing operators in PB.jwrjrjwrjr wrote:On the other hand you can make "^" do anything you want it to by judicious use of ()!
Why has the above minus sign the highest priority?Help wrote: Priority Level | Operators
---------------+---------------------
8 (high) | ~, - <--- look for this minus sign
7 | <<, >>, %, !
6 | |, &
5 | *, /
4 | +, -
3 | >, >=, <, <=, =, <>
2 | Not
1 (low) | And, Or, XOr
That's what my parser does, as I wrote here repeatedly.Lord wrote:when a mathematician gives a programmer "-9^0.5" you have
to evaluate according to mathematic rules
Sorry, but still this is not true.Little John wrote:...Lord wrote:when a mathematician gives a programmer "-9^0.5" you have
to evaluate according to mathematic rules
And the mathematical result of this expression clearly is nothing else but -(9^0.5) = -3
....
This statement will not become true, regardless how often you will repeat it.Lord wrote:-9^0.5 = i*3 is the only correct answer.
Since your are not in need of a parser from me, and since I certainly did not write it for people like you,Lord wrote:But forget it, as I'm not in need for an parser from you.
In Microsoft Excel, just type the following as isGPI wrote:Please give me a example of -2^3 is (-2)^3. A link to serious web side which that that it is common.
Code: Select all
=-9^2