Double.IsNaN(Double) 메서드

정의

지정된 값이 숫자(NaN)가 아닌지 여부를 나타내는 값을 반환합니다.

public:
 static bool IsNaN(double d);
public:
 static bool IsNaN(double d) = System::Numerics::INumberBase<double>::IsNaN;
public static bool IsNaN(double d);
static member IsNaN : double -> bool
Public Shared Function IsNaN (d As Double) As Boolean

매개 변수

d
Double

배정밀도 부동 소수점 숫자입니다.

반품

계산되면 /&이고 , 그렇지 않으면 .입니다.

구현

예제

다음 코드 예제에서는 다음을 IsNaN사용하는 방법을 보여 줍니다.

// This will return true.
if (Double.IsNaN(0 / zero))
   Console.WriteLine("Double.IsNan() can determine whether a value is not-a-number.");
// This will return true.
if Double.IsNaN(0. / zero) then
    printfn "Double.IsNan() can determine whether a value is not-a-number."
' This will return true.
If Double.IsNaN(0 / zero) Then
    Console.WriteLine("Double.IsNan() can determine whether a value is not-a-number.")
End If

설명

부동 소수점 연산은 작업의 결과가 정의되지 않음을 알리는 신호로 돌아갑니다 NaN . 예를 들어 0.0을 0.0으로 나누면 .NaN

메모

값이 <a0/0>이 반환 됩니다. 이러한 값을 테스트하려면 , IsInfinityIsPositiveInfinity 메서드를 IsNegativeInfinity사용합니다.

적용 대상

추가 정보