I have a variable that is receiving this value, which is not a STRING, so what is this? And is there any way to detect if the variable is equal to this through an IF?
I have a variable that is receiving this value, which is not a STRING, so what is this? And is there any way to detect if the variable is equal to this through an IF?
% wrapper, which is a special type of% silent wrapper is generated under specific conditions. If you run an invalid arithmetic operation as adding positive infinity and negative infinity , or taking the square root of a negative number, then requires that the result be a% silent , but it does not seem to specify exactly what% with . Different manufacturers of NaN Indefinido
processors have chosen different paths.
The undefined term NaN
refers to this NaN
special, whichever processor it ends up by choosing it to be.
Some floating-point processors generate a silent with the clear signal bits, but the signal bit set. Setting the signal bit makes the result negative, so on these processors, you will see NaN
rendered as an undefined negative NaN. (X86 is one such processor.)
Other processors of ponto flutuante
generate a NaN
silent with the signal bits and the signal bit cleared. Clear the signal bit makes the result positive, so on these processors, you will see the undefined NaN rendered as an undefined positive NaN.
In practice, the difference is not important, because anyway, you will have a NaN
.
Translated text from link
How to validate - example:
double a = 1, b = 0, c = 0;
double resultado = (a - b) / c;
if (double.IsNaN(resultado)) {
Console.WriteLine("Não é um número!");
} else {
Console.WriteLine("Número válido!");
}