{} breacket is not working , throw error invalid express
"4 3 +" expression is throwing invalid syntax error
how to add factorail
how to add factorail
Hi Jean-Marc, Thanks for your feedback. What I would like to use were the operators "==", "<", "<=", ">" and ">=". I'll take a look at the examples you cited. Thank you very much. Adalberto.
Allow reusing tokens
Equality and Relational Operators Evaluation
Hello, Thanks for the compliments :-) Unfortunately, my answer will not be the one you expect ... As you can see in previous tickets, lot of people want their own evaluator (BigDecimal, boolean, vectors, with more functions, etc... or mixed boolean and numbers - like you if I understood well). Some use Javaluator with their own grammars. That's the reason why Javaluator offers AbstractEvaluator, a generic evaluator, that is doing the hard part (parsing the expression and deals with operators precedence)....
Equality and Relational Operators Evaluation
Thank you! Building a simple token cache and re-using the list of tokens in the overridden tokenize method did the trick.
Hello, Sorry for answering late, I was very busy these last days ... I agree it should have been better to provide a way to reuse the tokens. But ... The bad news is the tokenize method returns an Iterator, which can't be traversed more than one time. Changing that would introduced a breaking change :-( The good news is it is very simple to subclass your Evaluator class, add attributes to the sub-class to store the tokens in a reusable form (a list for instance), and the expression that corresponds...
Allow reusing tokens
Error for Scientific Notation
Version 3.0.3 released yesterday allows you to create a scientific notation tolerant DoubleEvaluator using: new DoubleEvaluator(DoubleEvaluator.getDefaultParameters(), true) Please note the scientifc notation is not supported by default because it reduces the evaluator speed by a factor of 2 :-(
version 3.0.3
First implementation of scientific notation support in DoubleEvaluator
Error for Scientific Notation
A problem in the operator detection leads to this bug. Should not consider a + as an operator if previous char is E. Work in progress
Error for Scientific Notation
Is there any way to utilize this evaluator using variables of type in rather than double?
wrong double conversion
Hello, I think you made a confusion between java.lang.Math.log(x) which is the natural logarithm of x, and log(x) in javaluator, which is the base 10 algorithm of x. In javaluator, as stated in the DoubleEvaluator class documentation, you should use ln(x) to have the natural logarithm of x. Best regards, Jean-Marc Astesana
i forgot to mention. after expresion evaluation i get 208.5195006702843 and the correct answer is 23.93
wrong double conversion
Hello, As you can see in previous tickets, lot of people want their own evaluator (BigDecimal, boolean, more functions, etc...). Some use Javaluator with their own grammars. That's the reason why Javaluator offers AbstractEvaluator, a generic evaluator, that is doing the hard part (parsing the expression and deals with operators precedence). Javaluator provides DoubleEvaluator as an example of how to implement your own evaluator ... and because working with double is really very very common. We do...
Is there any way to utilize this evaluator using variables of type in rather than double?
What should I do to add factorial function?
Hello, You have a full working example that adds the square root function to DoubleEvaluator here: http://javaluator.fathzer.com/en/doc/tutorial.php?chapter=extending Regards, Jean-Marc Astesana
What should I do to add factorial function?
Removes sonar configuration that is useless in recent Sonarqube versions
Fixes problems in javadoc
Unable to handle a String contains textual Operator
Hi, The problem is with the protected Iterator<String> tokenize(String expression). It should cut the expression into tokens following your own grammar. The example in the tutorial states the tokens are separated by blank character, but it is not the case in the example you have. So you'll have to write a customized tokenize method that would return the following tokens in your example: type=PORT AND A AND * true If you need quote and escaped quote, you should handle these customizations yourself,...
TestFunctionSeparatorHidenByBrackets fails
Hi, No known bug will survive year 2017 ;-) I released version 3.0.2 that solves the problem. Best regards Jean-Marc Astesana PS : Sorry for the delay, it's a shame ...
version 3.0.2
Hi, Thank you for your message. I finally resolve it by replacing the value that contains the operator with a String, and put the value in the map with the replaced String as the key. And then during evaluating the operands, I get the value from the map and use the value as the operand. Regards, Wenyuan
Hi, The problem is with the protected Iterator<String> tokenize(String expression). It should cut the expression into tokens following your own grammar. The example in the tutorial states the tokens are separated by blank character, but it is not the case in the example you have. So you'll have to write a customized tokenize method that whould return the following tokens in your example: type=PORT AND A AND * true If you need quote and escaped quote, you should handle these customizations yourself,...
Is there any way to escape the Operator?
Unable to handle a String contains textual Operator
Good to know this project is alive, at least the author reponds :)
Hello Christian, You're right, this is a known bug. The test is there to prevent...
TestFunctionSeparatorHidenByBrackets fails
Square Root
Hello, The main reason is that I think the hard part of evaluating an infix expression...
Square Root
Fixes incompatibilities with sourceforge hosting
Continue framework commonalization with Yapbam
Initial import.
Sir, you did not understand... (laughs) In my particular case, I cannot declare the...
Here is a version of your testing code that works without any subclass. It uses StaticVariableSet:...
Here is a version of your testing code that works, without any subclass and that...
This is what I tried to do: Override the toValue method of DoubleEvaluator as to...
Declare unkwon tokens as variables.
Hi, Sorry if I didn't understand the question but it seems using StaticVariableSet...
Declare unkwon tokens as variables.
x
Thank you very much :-)
Matrix Support
Hi, My understanding is the problem you have is '+' is not a token delimiter when...
Hi, My understanding is the problem you have is '+' is not a token delimiter when...
Here is a copy of a discussion I had with the author of the initial post: I want...
Here is a copy of a discussion I had with the author of the initial post: I want...
Here is a copy of a discussion I had with the author of the initial post: I want...
Matrix Support
DoubleEvaluator is not thread safe
Hi, Fix was included with version 3.0.1 released today. Thanks again for the bug...
v3.0.1
Cube root of -1
DoubleEvaluator is not thread safe
Cube root of -1
Thanks, fix will be delivered soon (fixed in development version). Best regards Jean-Marc...
Hello, Unfortunately, I think this is a "bug/strange feature" of java.lang.Math,...
Copyright
DoubleEvaluator is not thread safe
Cube root of -1
Initial import.
Initial import.
Hello, Javaluator is distributed under LGPLv3 license. I'm not a lawyer, nor an native...