| View previous topic :: View next topic |
| Author |
Message |
Paul Williamson
Joined: 29 Nov 2006 Posts: 88
|
Posted: Thu May 19, 2011 2:01 am Post subject: Negation after a binary operator |
|
|
I *must* be missing something in the expression syntax.
x*y -- OK
-x*y -- OK
x*-y -- "Illegal argument for binary operator"
This is with the latest beta 3.0. |
|
| Back to top |
|
 |
David Site Admin
Joined: 25 Nov 2006 Posts: 1541 Location: Chapel Hill, NC
|
Posted: Thu May 19, 2011 8:07 am Post subject: |
|
|
x*(-y)
David |
|
| Back to top |
|
 |
Paul Williamson
Joined: 29 Nov 2006 Posts: 88
|
Posted: Thu May 19, 2011 1:26 pm Post subject: |
|
|
OK, that's another workaround.
I'm curious about why this limitation arises. Is there some special syntax that DataGraph's expression evaluator accepts that makes unary negation and binary operators parse in this unusual way?
I didn't find anything about this limitation (or, indeed, about arithmetic operators at all) in the help. |
|
| Back to top |
|
 |
David Site Admin
Joined: 25 Nov 2006 Posts: 1541 Location: Chapel Hill, NC
|
Posted: Thu May 19, 2011 8:57 pm Post subject: |
|
|
I tweaked things so that x*-y is supported.
Will be in the next beta. Thanks.
David |
|
| Back to top |
|
 |
wkramer
Joined: 26 Mar 2009 Posts: 7
|
Posted: Mon May 23, 2011 10:17 am Post subject: |
|
|
But then x / -y should also be supported (and if you are really consequent x + -y and x - -y). And what about x ^ -y?
In general is is allowed to assume that the minus sign following a binary operator negates the second operand? |
|
| Back to top |
|
 |
David Site Admin
Joined: 25 Nov 2006 Posts: 1541 Location: Chapel Hill, NC
|
Posted: Mon May 23, 2011 1:42 pm Post subject: |
|
|
I agree. I tweaked things so that this would work.
I also found a problem that was related to this, such as x>-y and fixed it. Uploaded a new beta.
David |
|
| Back to top |
|
 |
|