HUGE Arithmetic BUG !!!

Everything else that doesn't fall into one of the other PB categories.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

HUGE Arithmetic BUG !!!

Post by Psychophanta »

Try this:

Code: Select all

Debug Pow(0,0)
It gives 1 :shock:

And in Windows calculator too Image
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

Err, not sure, but I think it's the right answer.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Polo wrote:Err, not sure, but I think it's the right answer.
Well, at least you have said "not sure", uhhfffff !
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

it is the right answer.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

Psychophanta wrote:
Polo wrote:Err, not sure, but I think it's the right answer.
Well, at least you have said "not sure", uhhfffff !
What do you mean ??
I'm not really good at maths :oops:
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Anything raised to the zero'th power is one.
User avatar
griz
Enthusiast
Enthusiast
Posts: 167
Joined: Sun Jun 29, 2003 7:32 pm
Location: Canada

Post by griz »

I've tested this in other languages and they return 1, so it's not a bug.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Some one, please?
Denmark, Canada, France ...
Who were your maths' teachers :?:
Image
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

http://faq.maths.free.fr/texte/faq13.html

sorry , it's in french , you can choose 0^0 = 0 or 0^0 = 1
Please correct my english
http://purebasic.developpez.com/
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Comtois wrote:http://faq.maths.free.fr/texte/faq13.html

sorry , it's in french , you can choose 0^0 = 0 or 0^0 = 1
Oufffh! Finally a nice reply!! Thanx :wink:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

However, that link talks about conventions, this is, needs depending on equations or math contexts interests.
0^0 is an error, and at least we need a valid result for that operation, in general it must be taken as ERROR while working with real numbers.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

0^0 is an error? i never heard anyone complaining about it...
i never ever heard that you can choose yourself either! Tried 4 calculators on my computer, my programmable Texas instruments 84+ , and other normal calculators.

oh also asked my father who has been at university for 7 years, he is a canc. scient and he said nearly angry when i asked if 0^0 could be 0: "0^0 is DEFINED to be 1!". so i doubt that you can choose yourself..


again it isnt an error its just defined that anything no matter what powered in 0, is 1!

you can read that in any math book from any university or whatever you want. Looked it up in my own gymnasium mathbook: x^0 is defined to be 1.

so the answer is only 100% correct, if you can trust a cand.scient with highest math grade on university, a mathbook, 4 pc-calculators and a programmable graph-calculator.

so in general it shall NOT be taken as an error. If PB did that it would go against the law of maths lol then we could suspect it to let 2+2=5.. who knows??
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

thefool wrote: i never heard anyone complaining about it...
Yes, thefool, yes, 0^0 is an error whenever we work with real values.
If you have never heard about it, then i can only understand you have never had a math teacher. :)
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

hmm sorry my math teacher is only an cand. scient datalog..
but whatever..
why is it an error? its NOT

i doubt my calc uses false numbers :)
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

TheFool is correct, the answer is 1.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply