Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Single.PositiveInfinity Field

Definition

Namespace:
System
Assemblies:
mscorlib.dll, System.Runtime.dll
Assemblies:
netstandard.dll, System.Runtime.dll
Assembly:
System.Runtime.dll
Assembly:
mscorlib.dll
Assembly:
netstandard.dll
Source:
Single.cs
Source:
Single.cs
Source:
Single.cs
Source:
Single.cs
Source:
Single.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Represents positive infinity. This field is constant.

public: float PositiveInfinity = Infinity;
public const float PositiveInfinity = Infinity;
val mutable PositiveInfinity : single
Public Const PositiveInfinity As Single = Infinity

Field Value

Value = Infinity

Examples

The following code example demonstrates the PositiveInfinity constant.

// This will equal Infinity.
Console.WriteLine("PositiveInfinity plus 10.0 equals {0}.", (Single.PositiveInfinity + 10.0).ToString());
// This will equal Infinity.
printfn $"PositiveInfinity plus 10.0 equals {Single.PositiveInfinity + 10f}."
' This will equal Infinity.
Console.WriteLine("PositiveInfinity plus 10.0 equals " + (Single.PositiveInfinity + 10).ToString() + ".")

Remarks

The value of this constant is the result of dividing a positive number by zero.

This constant is returned when the result of an operation is greater than MaxValue.

Use IsPositiveInfinity to determine whether a value evaluates to positive infinity.

Applies to

See also


Feedback

Was this page helpful?