Single.IsNaN Method

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

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

'Declaration
Public Shared Function IsNaN ( _
	f As Single _
) As Boolean

Parameters

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) Then
   outputBlock.Text &= "Single.IsNan() can determine whether a value is not-a-number." & vbCrLf
End If


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2015 Microsoft