AngouriMath

Navigation

← Back to list of members

IsConstant

 Property

Summary

Determines whether a given element can be unambiguously used as a number or boolean

Example

using System;
using static AngouriMath.MathS;

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

Prints
False
False
-----------------------------
False
True
-----------------------------
True
-----------------------------
True

























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