Performs mathematical expression evaluation, takes string input, ignores spaces, returns a number, e.g.
- calc('-123') = -123
- calc('-1 +1') = 0
- calc('2 /2+3 * 4.75- -6') = 21.25
- calc('2 / (2 + 3) * 4.33 - -6') = 7.732
- calc('(123.45 * (678.90/(-2.5+11.5)-(((80-(19))) * 33.25))/20)-(123.45* (678.90/(-2.5+11.5)-(((80-(19))) * 33.25))/20)+(13-2)/-(-11)') = 1
A script by V.