We are using the Math.js library for evaluating the string expressions in Angular. Now we need to implement the same in C# for the same expression. Is there any equivalent library to Math.Js in C# or can we call Math.js library in C#?
below is an example string expression which can be evaluated using math js
a = 2, b = 3, c = 3, d = 5, e = 7
ceil(a)*b+(ceil(c)+1)*(d+e)
The equivalent of Math.Js in C# would be the Math class that is a part of the
System.Runtime.Extension.dllassembly. That provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions.Down below is a conversion to Math class based on the example in your question.
Working example: https://dotnetfiddle.net/GOsGsi