Single.IsInfinity(Single) Method
Definition
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.
Returns a value indicating whether the specified number evaluates to negative or positive infinity.
public:
static bool IsInfinity(float f);
public:
static bool IsInfinity(float f) = System::Numerics::INumberBase<float>::IsInfinity;
public static bool IsInfinity (float f);
static member IsInfinity : single -> bool
Public Shared Function IsInfinity (f As Single) As Boolean
Parameters
- f
- Single
A single-precision floating-point number.
Returns
true
if f
evaluates to PositiveInfinity or NegativeInfinity; otherwise, false
.
Implements
Examples
The following code example demonstrates the IsInfinity method.
// This will return S"true".
Console::WriteLine( "IsInfinity(3.0F / 0) == {0}.", Single::IsInfinity( 3.0F / zero ) ? (String^)"true" : "false" );
// This will return "true".
Console.WriteLine("IsInfinity(3.0F / 0) == {0}.", Single.IsInfinity(3.0F / 0) ? "true" : "false");
// This will return "true".
printfn $"IsInfinity(3.0F / 0) == %b{Single.IsInfinity(3f / 0f)}."
' This will return "True".
Console.Write("IsInfinity(3.0 / 0) = ")
If Single.IsPositiveInfinity(3 / 0) Then
Console.WriteLine("True.")
Else
Console.WriteLine("False.")
End If
Remarks
Floating-point operations return PositiveInfinity or NegativeInfinity to signal an overflow condition.
Applies to
See also
GitHub पर हमारे साथ सहयोग करें
इस सामग्री का स्रोत GitHub पर पाया जा सकता है, जहाँ आप समस्याएँ बना और समीक्षा भी कर सकते हैं और अनुरोध खींच सकते हैं. अधिक जानकारी के लिए, हमारे योगदानकर्ता गाइड देखें.