MVEL. eval Numerical Calculation

Source: Internet
Author: User

MVEL. eval Numerical Calculation

MVEL can calculate numeric values in the form of strings, which is very simple to use.

However, when a colleague encounters a problem and finds a problem, when multiple numeric values are multiplied and then added together, if the result of the calculation greater than or equal to three is incorrect or an error is reported

For example, if a * B + c * d + e * f is added to three consecutive product numbers, an error occurs.

However, it may be due to the jar package version of the tool. The updated version is not tested.


Some conceptual problems in the numerical calculation method

You are a teacher. These things are generally used by the teacher for preparing lessons. You can find some textbooks or search for them online, no one answered this question. It is too complicated and too textual.

C language Numerical Calculation

(A + = a ++, a * 2, ++)
---------------------
A + = a ++ returns a = 5
A * 2 is not assigned a value, which is equal to not executed.
++ A calculates a = 6

B = 2 + comma expression rightmost Value
= 8

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.