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

Variable 'e' is no longer parsed properly #38

Closed
keyneom opened this issue Jan 2, 2019 · 4 comments
Closed

Variable 'e' is no longer parsed properly #38

keyneom opened this issue Jan 2, 2019 · 4 comments
Labels

Comments

@keyneom
Copy link

keyneom commented Jan 2, 2019

A change was recently made to add support for scientific notation. I believe in doing so we lost the ability to use the built-in variable e.

Attempts to use any formula using the variable e as previously done now fail. e.g.

var engine = new CalculationEngine(CultureInfo.InvariantCulture, ExecutionMode.Compiled);
var result = engine.Calculate("e");

When using more complex functions (1 * e) you receive a rather unclear error message:

There is a syntax issue for the operation \"*\" at position 2. The number of arguments does not match with what is expected.

Reverting the following line change seems to avoid the issue, but I am sure will also prevent the scientific notation support from functioning properly:

return character == decimalSeparator || (character >= '0' && character <= '9') || (isFormulaSubPart && isFirstCharacter && character == '-') || character == 'e' || character == 'E';

@keyneom
Copy link
Author

keyneom commented Jan 2, 2019

@pieterderycke Was this an intended change? There are some performance changes recently released I am anxious to try out but the above issue is preventing us from doing so.

@pieterderycke
Copy link
Owner

@keyneom Thanks for letting me know. I will look to fix the bug and to release a bug fix release

pieterderycke added a commit that referenced this issue Jan 2, 2019
@pieterderycke
Copy link
Owner

I have released a Jace 0.9.2 to fix this bug

@keyneom
Copy link
Author

keyneom commented Jan 2, 2019

Amazingly fast!! Thank you so much!!

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

No branches or pull requests

2 participants