It works!

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

It works!

Post by Psychophanta »

Code: Select all

Debug e-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------5
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Re: It works!

Post by Joakim Christiansen »

:|
I like logic, hence I dislike humans but love computers.
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: It works!

Post by freak »

So what? It's a correct expression.
quidquid Latine dictum sit altum videtur
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: It works!

Post by Psychophanta »

Just offtopic-ing!
anyway i ask myself why if replace '-' by '+' it does not work
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
eesau
Enthusiast
Enthusiast
Posts: 589
Joined: Fri Apr 27, 2007 12:38 pm
Location: Finland

Re: It works!

Post by eesau »

Because your expression is e minus (lots of unary minuses) 5. There is no unary plus operator.
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: It works!

Post by Shield »

Mathematically speaking it's wrong as it's not allowed to have two operators next to each other.
Why is it allowed and why aren't multiple + operators allowed? Because it's PureBasic.

Simple as that.
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
eesau
Enthusiast
Enthusiast
Posts: 589
Joined: Fri Apr 27, 2007 12:38 pm
Location: Finland

Re: It works!

Post by eesau »

The expression is actually evaluated as (shortened here) e-(-(-(-(-(-5))))) which is perfectly valid, even in mathematics.
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: It works!

Post by Shield »

...of course I was talking about PB's implementation.
It doesn't matter how it's interpreted, the notation is still wrong.

And I'm not saying it bothers me (as I would never write it like that because it simply doesn't make sense to do so).
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
Post Reply