You can tell if there is a mathematical library for performing an arbitrary arithmetic function, taking into account the division by 0. For example, I have a string, which is transformed into an arithmetic expression by some transformation
"1 + 2 / 0"; Executing this expression with the eval () function will give the error "Division by zero". But I need such 2/0 plots to be defined and give the value 0. This is important, since I have a few hundred lines of this type that are generated on the fly. There are lines in which there are many levels of calculation with quotes, when the data is first calculated in quotes (with division by 0), then divided into a variable (which can also be zero), etc. Manual analysis of such lines for manual interception of such places I could not write - it is very difficult. Are there any libraries that can work around this error correctly? Tried the following libraries:
- rodriados / mathr
- mossadal / math-parser
- fintara / calculator-php
They all do not fit