AngouriMath
IsFinite
Property
meaning that it could be safely used for calculations.
By finite we mean that it is not a NaN and it is not positive or negative infinity.
Example
using System;
using static AngouriMath.MathS;
var x = Var("x");
var expr1 = Sin(x);
Console.WriteLine($"{expr1}, IsFinite: {expr1.IsFinite}");
var expr2 = Sin(x + 5) + 5;
Console.WriteLine($"{expr2}, IsFinite: {expr2.IsFinite}");
var expr3 = Sin(x + 3) / 0;
Console.WriteLine($"{expr3}, IsFinite: {expr3.IsFinite}");
var expr4 = expr3.Evaled;
Console.WriteLine($"{expr4}, IsFinite: {expr4.IsFinite}");
var expr5 = Sin(x / 0);
Console.WriteLine($"{expr5}, IsFinite: {expr5.IsFinite}");
var expr6 = x + +oo;
Console.WriteLine($"{expr6}, IsFinite: {expr6.IsFinite}");
var expr7 = x + +oo * i;
Console.WriteLine($"{expr7}, IsFinite: {expr7.IsFinite}");
var expr8 = -oo + 6 * i;
Console.WriteLine($"{expr8}, IsFinite: {expr8.IsFinite}");
var expr9 = Sin(+oo) - Cos(pi / 3);
Console.WriteLine($"{expr9}, IsFinite: {expr9.IsFinite}");
var expr10 = Hyperbolic.Tanh(NaN + 3);
Console.WriteLine($"{expr10}, IsFinite: {expr10.IsFinite}");
Prints
sin(x), IsFinite: True
sin(x + 5) + 5, IsFinite: True
sin(x + 3) / 0, IsFinite: True
NaN, IsFinite: False
sin(x / 0), IsFinite: True
x + +oo, IsFinite: False
x + +ooi, IsFinite: False
-oo + 6i, IsFinite: False
sin(+oo) - cos(pi / 3), IsFinite: False
(e ^ (2 * (NaN + 3)) - 1) / (e ^ (2 * (NaN + 3)) + 1), IsFinite: False
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1534 pages online