The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Single.IsNaN Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns a value indicating whether the specified number evaluates to not a number (NaN).

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public static bool IsNaN(
	float f


Type: System.Single
A single-precision floating-point number.

Return Value

Type: System.Boolean
true if f evaluates to not a number (NaN); otherwise, false.

Floating-point operations return NaN to signal that that result of the operation is undefined. For example, dividing 0.0 by 0.0 results in NaN.

The following code example demonstrates the IsNaN method.

// This will return true.
if (Single.IsNaN(0 / zero))
   outputBlock.Text += "Single.IsNan() can determine whether a value is not-a-number." + "\n";

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone