Page 1 of 1

It works!

Posted: Thu Mar 21, 2013 1:34 pm
by Psychophanta

Code: Select all

Debug e-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------5

Re: It works!

Posted: Thu Mar 21, 2013 7:53 pm
by Joakim Christiansen
:|

Re: It works!

Posted: Thu Mar 21, 2013 9:44 pm
by freak
So what? It's a correct expression.

Re: It works!

Posted: Thu Mar 21, 2013 9:48 pm
by Psychophanta
Just offtopic-ing!
anyway i ask myself why if replace '-' by '+' it does not work

Re: It works!

Posted: Thu Mar 21, 2013 10:15 pm
by eesau
Because your expression is e minus (lots of unary minuses) 5. There is no unary plus operator.

Re: It works!

Posted: Thu Mar 21, 2013 10:19 pm
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.

Re: It works!

Posted: Thu Mar 21, 2013 10:28 pm
by eesau
The expression is actually evaluated as (shortened here) e-(-(-(-(-(-5))))) which is perfectly valid, even in mathematics.

Re: It works!

Posted: Thu Mar 21, 2013 10:52 pm
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).