Are variables case-sensitive in exprtk?
Asked Answered
P

2

12

When I define an expression in my exprtk string, like

var x := sqrt(y);

and I try to add another variable

var X := 2*z;

do I get a conflict? Thanks in advance.

Plebeian answered 26/8, 2016 at 14:40 Comment(6)
Why not give it a try?Shampoo
Why use the C++ tag? The syntax you presented is not valid for C++.Joint
Thomas: because exprtk is a C++ library. Robert: I just tested it here, and I get a conflict. Should I remove the question?Plebeian
@LucioCarlosPimentelPaiva just answer your question yourself if you have found the answer,Nehemiah
Right. Thanks for the advicePlebeian
I don't know if it's expected or not. But it gave me a headache for hours when I tried to debug my code.Plebeian
E
11

As of March 2017, the author of exprtk has added support for case sensitive variables: https://github.com/ArashPartow/exprtk/blob/master/readme.txt#L4477

Just include #define exprtk_disable_caseinsensitivity and you are good to go!

Erelia answered 29/5, 2017 at 23:40 Comment(1)
Nice! It didn't exist when I posted the question, it's good to know that it is supported now. ThanksPlebeian
P
10

I just found the answer: variables defined within exprtk expressions are NOT case sensitive. In the example above you will get a conflict.

Plebeian answered 26/8, 2016 at 15:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.