visualdatatools.com Forum Index visualdatatools.com
Discussion for DataTank and DataGraph
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Negation after a binary operator

 
Post new topic   Reply to topic    visualdatatools.com Forum Index -> Bug Report
View previous topic :: View next topic  
Author Message
Paul Williamson



Joined: 29 Nov 2006
Posts: 88

PostPosted: Thu May 19, 2011 2:01 am    Post subject: Negation after a binary operator Reply with quote

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
View user's profile Send private message
David
Site Admin


Joined: 25 Nov 2006
Posts: 1541
Location: Chapel Hill, NC

PostPosted: Thu May 19, 2011 8:07 am    Post subject: Reply with quote

x*(-y)

David
Back to top
View user's profile Send private message Send e-mail
Paul Williamson



Joined: 29 Nov 2006
Posts: 88

PostPosted: Thu May 19, 2011 1:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
David
Site Admin


Joined: 25 Nov 2006
Posts: 1541
Location: Chapel Hill, NC

PostPosted: Thu May 19, 2011 8:57 pm    Post subject: Reply with quote

I tweaked things so that x*-y is supported.

Will be in the next beta. Thanks.

David
Back to top
View user's profile Send private message Send e-mail
wkramer



Joined: 26 Mar 2009
Posts: 7

PostPosted: Mon May 23, 2011 10:17 am    Post subject: Reply with quote

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
View user's profile Send private message
David
Site Admin


Joined: 25 Nov 2006
Posts: 1541
Location: Chapel Hill, NC

PostPosted: Mon May 23, 2011 1:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    visualdatatools.com Forum Index -> Bug Report All times are GMT - 3 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group