Eval-Expression.NET icon indicating copy to clipboard operation
Eval-Expression.NET copied to clipboard

Wrong calculations with Carets as Exponent

Open benjaminrupp opened this issue 1 year ago • 4 comments

Hi,

I have a problem with carets is an expression. I am using the flag UseCaretForExponent = true.

10^3 = 1000 like expected but 0.466*10^3 is not 466 like expected but 101.1946.

This is quite an issue for us, because this is not expected.

Thanks

Benjamin

benjaminrupp avatar Jul 12 '24 07:07 benjaminrupp

Hello @benjaminrupp ,

Thank you for reporting. I can confirm that we have this issue.

The 0.466*10^^3 will work correctly (2 caret), but indeed, using it with only 1 caret leads to this issue.

We will look at it.

Best Regards,

Jon

JonathanMagnan avatar Jul 12 '24 07:07 JonathanMagnan

Hello @benjaminrupp ,

Just to let you know that a fix has been merged and will be available on July 23

Best Regards,

Jon

JonathanMagnan avatar Jul 14 '24 09:07 JonathanMagnan

Thanks. This is great

benjaminrupp avatar Jul 15 '24 05:07 benjaminrupp

Hello @benjaminrupp ,

The v6.1.8 has been released.

Let us know if everything is working as expected.

For your information, in C# Eval Expression, we use a right-associativity in case of multiple caret such as a^b^c. You can see a good comparison of which language use this one or the expected result here: https://codeplea.com/exponentiation-associativity-options

Best Regards,

Jon

JonathanMagnan avatar Jul 22 '24 22:07 JonathanMagnan