Windows Dev Center

Single.IsInfinity Method

Returns a value indicating whether the specified number evaluates to negative or positive infinity.

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

public static bool IsInfinity(
	float f


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

Return Value

Type: System.Boolean
true if f evaluates to PositiveInfinity or NegativeInfinity; otherwise, false.

Floating-point operations return PositiveInfinity or NegativeInfinity to signal an overflow condition.

The following code example demonstrates the IsInfinity method.

// This will return "true".
outputBlock.Text += String.Format("IsInfinity(3.0F / 0) == {0}.", Single.IsInfinity(3.0F / 0) ? "true" : "false") + "\n";

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2015 Microsoft