operator ^ for power

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: operator ^ for power

Post by Lord »

@said:
Dont' try further, it's useless. They don't want to understand. :?
Real mathematicians understand, others don't.... :wink:
I'm out of this.
Image
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: operator ^ for power

Post by Little John »

Lord wrote:You have to set correct parenthesis in order to get a correct result.
Lord wrote:-9^0.5 = i*3 is the only correct answer.
Lord wrote:Real mathematicians understand, others don't
You mean "real mathematicians" like you, who are not sure what they want to believe, and who at he same time think they know better than e.g. Wolfram Alpha?
Image
This actually seems to apply here. :-)
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: operator ^ for power

Post by GPI »

Its a funny thing. It seems that excel calculate wrong (Maybe because of compatiblity reasons).

Code: Select all

-9^2	81
(-9)^2	81
0-9^2	-81
-(9^2)	-81
2^2^2^2	256
2^(2^(2^2))	65536
(((2^2)^2)^2)	256
that 2^2^2^2 = 256 is definitiv wrong.

I found something in the wikipedia (sorry, only in German):
https://de.wikipedia.org/wiki/Un%C3%A4res_Minus
It seems, that Unary Minus is not common in the Mathematics.
https://en.wikipedia.org/wiki/Unary_operation

And:
https://en.wikipedia.org/wiki/Order_of_operations
However, some computer systems may resolve the ambiguous expression differently. For example, Microsoft Office Excel evaluates a^b^c as (a^b)^c, which is opposite of normally accepted convention of top-down order of execution for exponentiation.
edit: btw. who is brave engouth to write to MS, that Excel and for example Visual Basic calculate 2^2^2 and -2^2 complete diffrent?
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: operator ^ for power

Post by Danilo »

GPI wrote:edit: btw. who is brave engouth to write to MS, that Excel and for example Visual Basic calculate 2^2^2 and -2^2 complete diffrent?
For VB, it is documented in the VB help (see Remarks). Check Excel help, it's probably also documented.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: operator ^ for power

Post by GPI »

Danilo wrote:For VB, it is documented in the VB help (see Remarks). Check Excel help, it's probably also documented.
Because it is documented, it doesn't mean that it is right. In mathematics only one can be right, not both.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: operator ^ for power

Post by Danilo »

GPI wrote:Because it is documented, it doesn't mean that it is right.
It could mean that MS probably already knows about it, but of course you are free to write them anyway. :D
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: operator ^ for power

Post by Tenaja »

If you are an archeologist, are you going to lecture a gardener on the proper use of a shovel? No, it would slow the gardener down. Likewise, an archeologist would not be wise to listen to a gardener, as he could damage artifacts.

Likewise, do not get too worked up about what others are doing with their shovel (or mathematical symbols) just because you use it for delicate work, and someone else just wants to get the job done asap. If you don't like they way LJ is using his shovel, then write your own!
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: operator ^ for power

Post by Shield »

GPI wrote:Because it is documented, it doesn't mean that it is right. In mathematics only one can be right, not both.
This only applies to concepts, not to notation.
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: operator ^ for power

Post by Lord »

Finally:
Little John wrote:...
You mean "real mathematicians" like you, who are not sure what they want to believe, and who at he same time think they know better than e.g. Wolfram Alpha?
...
That's the center of your small universe? Sorry for that.
Little John wrote:...
This actually seems to apply here. :-)
...
Excellent self diagnosis.
Image
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: operator ^ for power

Post by Little John »

Lord wrote:Finally:
Little John wrote:...
You mean "real mathematicians" like you, who are not sure what they want to believe, and who at he same time think they know better than e.g. Wolfram Alpha?
...
That's the center of your small universe? Sorry for that.
No, it isn't. And I didn't write anything like that.
You are not even able to understand a simple sentence, or you are deliberately trying to distort its sense.
This is an impressive demonstration of how you are replacing facts with weird assumptions.
No further comment required.
Last edited by Little John on Wed Oct 07, 2015 8:00 am, edited 1 time in total.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: operator ^ for power

Post by GPI »

Lord wrote:Excellent self diagnosis.
At the beginning, I also thought, that Little John was wrong.

It is always a good Idea to keep in Mind, that maybe it is wrong. In this case I try to find information in the Internet about this things. I found only sources, that -2^9 is equal to -(2^9). Only Excel (and Open/Libre Office - I think because of compatiblity reasons) calculates diffrent. But Excel handle the power-Operator in other cases also complete false (yes it is documentet, but that doesn't change anything).

And there are Mathematic Rules. For Example: 2+2*2 = 6 and not 8.

But you don't do something like this: You don't search for Answers. I asked you to link any sources, that you are right.
Post Reply