AngouriMath
Iverson(AngouriMath.Entity)
Method (no overloads)
Summary
The Iverson bracket iverson(P) : 1 where the statement holds, 0 where it does not
Parameter "statement"
The statement
Returns
The Iversonf node
Remarks
A statement that is not decided is kept as the node. A count is a sum of these:
sum(iverson(k divides 12), k, 1, 12) is the number of divisors of 12 .
https://github.com/asc-community/AngouriMath/issues/1478
https://github.com/asc-community/AngouriMath/issues/1478
Example
using System;
using static AngouriMath.MathS;
Console.WriteLine(Iverson("3 divides 12").Simplify());
Console.WriteLine(Iverson("2 > 3").Simplify());
Console.WriteLine(Iverson("x > 0").Simplify());Prints
1
0
iverson(x > 0)Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online