I am working on a project where I need to create a function that will analyze 4 mathematical operations by default (addition, subtraction, multiplication, division). It would be nice if the function could analyze operations between brackets.
Thus, a prerequisite is that the function first checks the operations of multiplication and division (you should check this after it analyzes all the operations between the brackets, if they exist, and this rule should be applied to operations with brackets [the biggest problem is that brackets may contain brackets]). After performing all operations of multiplication and division, he must perform all operations of addition and subtraction. The final number must be returned by functions.
Another nice addition would be the RegExp line, which will check math operations.
Thanks in advance!
user726049
source share