I have a Dictionary<string, double> values
and values precision is important for me. I have a string Formula that Infix can Parse. I wonder how to do something like this:
var expr = Infix.ParseOrThrow(m.Formula);
var result = Evaluate.Evaluate<double>(values, expr);
to get a result with double precision?
Evaluate operates on a custom
FloatingPoint
type which can represent various double-precision floating-point values (mostly real or complex numbers, in theory also vectors or matrices). You can cast adouble
to aFloatingPoint
, and useRealValue
to get a double back from aFloatingPoint
.Example: