AngouriMath

Navigation

← Back to list of members

Evaled

 Property

Summary

Represents the evaluated value of the given expression
Unlike the result of EvalNumerical and
EvalBoolean this is not constrained by any type.

It only performs an active operation in the first call,
next time it is free to call it in terms of CPU usage. For
consistency's sake, consider the call of this property
as free as the addressing of a field.

Example

using System;
using static AngouriMath.MathS;

var (x, y) = Var("x", "y");
var expr1 = x + y;
Console.WriteLine(expr1);
Console.WriteLine(expr1.Evaled);
Console.WriteLine(expr1.Evaled.GetType());
Console.WriteLine("-----------------------------");
var expr2 = 5 + x * i;
Console.WriteLine(expr2);
Console.WriteLine(expr2.Evaled);
Console.WriteLine(expr2.Substitute(x, 3).Evaled);
Console.WriteLine(expr2.Substitute(x, 3).Evaled.GetType());
Console.WriteLine("-----------------------------");
var expr3 = GreaterThan(5, 3);
Console.WriteLine(expr3);
Console.WriteLine(expr3.Evaled);
Console.WriteLine(expr3.Evaled.GetType());

Prints
x + y
x + y
AngouriMath.Entity+Sumf
-----------------------------
5 + x * i
5 + x * i
5 + 3i
AngouriMath.Entity+Number+Complex
-----------------------------
5 > 3
True
AngouriMath.Entity+Boolean

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1534 pages online