Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arithmetics is wrong in eval method #429

Closed
madshall opened this issue Apr 7, 2016 · 1 comment
Closed

Arithmetics is wrong in eval method #429

madshall opened this issue Apr 7, 2016 · 1 comment
Milestone

Comments

@madshall
Copy link

madshall commented Apr 7, 2016

The TICK script contains:

stream.eval(lambda: "val1" / "val2" * 100.0)
    .as('newVal')

When it comes down to log file I see the newVal being 10000 less than expected.

This works fine though:

stream.eval(lambda: 100.0 * "val1" / "val2" )
    .as('newVal')

Using v0.11.0

@nathanielc
Copy link
Contributor

@madshall Sorry for taking so long to get back to you.

Looking back at the TICKscript parser it was implemented as a right-associative parser which is confusing since most expressions parsers use left-association. TICKscript is interpreting the expression as

stream.eval(lambda: "val1" / ("val2" * 100.0)) which isn't what you meant.

We should change the association of the parser. We will use this issue to track the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants