AngouriMath

Navigation

← Back to list of members

Equality​(AngouriMath.​Entity,​AngouriMath.​Entity)

 Method (no overloads)

Summary

Do NOT confuse it with Equation

Parameter "a"

Left argument node of which Equality function will be taken

Parameter "b"

Right argument node of which Equality disjunction function will be taken

Returns

An Equals node

Example

using System;
using static AngouriMath.MathS;

var (x, y) = Var("x", "y");
var equation = Equality(Sqrt(x), 4 * x - 3);
Console.WriteLine(equation);
Console.WriteLine(equation.Solve(x));
Console.WriteLine("----------------------");
var statement1 = Equality(5, 10);
Console.WriteLine(statement1);
Console.WriteLine((bool)statement1.EvalBoolean());
Console.WriteLine("----------------------");
var statement2 = Equality(5, 5);
Console.WriteLine(statement2);
Console.WriteLine((bool)statement2.EvalBoolean());
Console.WriteLine("----------------------");
var statement3 = Equality(x, y);
Console.WriteLine(statement3);
Console.WriteLine(statement3.Simplify());
// throws here!
Console.WriteLine((bool)statement3.EvalBoolean());

Prints
sqrt(x) = 4 * x - 3
{ 9/16, 1 }
----------------------
5 = 10
False
----------------------
5 = 5
True
----------------------
x = y
x = y
Unhandled exception. AngouriMath.Core.Exceptions.CannotEvalException

























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