AngouriMath

Navigation

← Back to list of members

NaN

 Field

Summary

That is both undefined and indeterminite
Any operation on NaN returns NaN

Example

Let's consider oo and NaN.
using System;
using static AngouriMath.MathS;

var (x, y) = Var("x", "y");
var expr1 = Sin(x) / y;
Console.WriteLine(expr1);
Console.WriteLine(expr1.Substitute(y, 0));
Console.WriteLine(expr1.Substitute(y, 0).Evaled);
Console.WriteLine(expr1.Substitute(y, 0).Evaled == NaN);
Console.WriteLine("--------------------------------");
var expr2 = 5 + NaN;
Console.WriteLine(expr2);
Console.WriteLine(expr2.Evaled);
Console.WriteLine("--------------------------------");
var expr3 = Sin(NaN) / Cos(x) + y;
Console.WriteLine(expr3);
Console.WriteLine(expr3.Evaled);
Console.WriteLine("--------------------------------");
var expr4 = 10 * +oo;
Console.WriteLine(expr4);
Console.WriteLine("--------------------------------");
var expr5 = -oo * +oo;
Console.WriteLine(expr5);
Console.WriteLine("--------------------------------");
var expr6 = -oo / +oo;
Console.WriteLine(expr6);
Console.WriteLine("--------------------------------");
var expr7 = 50 / -oo;
Console.WriteLine(expr7);

Prints
sin(x) / y
sin(x) / 0
NaN
True
--------------------------------
5 + NaN
NaN
--------------------------------
sin(NaN) / cos(x) + y
NaN
--------------------------------
+oo
--------------------------------
-oo
--------------------------------
NaN
--------------------------------
0

See IsFinite for determining
if there are NaNs or infinities inside an expression.

























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