AngouriMath

Navigation

← Back to list of members

Provided​(AngouriMath.​Entity,​AngouriMath.​Entity)

 Method (no overloads)

Summary

This will be turned into expression if the condition is true,
into NaN if condition is false, and remain the same otherwise

Parameter "expression"

The expression is extracted if the predicate is true

Parameter "condition"

Condition when the expression is defined

Returns

The Provided node

Example

using System;
using static AngouriMath.MathS;
Console.WriteLine(Provided("a = b", "pi = 4"));
Console.WriteLine(Provided("a = b", "pi = 4").Simplify());
Console.WriteLine();

var expr = Provided("1000", "a = b")
        .Substitute("a", 5)
        .Substitute("b", 130)
    ;
Console.WriteLine(expr);
Console.WriteLine(expr.Evaled);

Console.WriteLine();

var expr1 = Provided("1000", "a = b")
        .Substitute("a", 5)
        .Substitute("b", 5)
    ;
Console.WriteLine(expr1);
Console.WriteLine(expr1.Evaled);

Prints
a = b provided pi = 4
NaN

1000 provided 5 = 130
NaN

1000 provided 5 = 5
1000

























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