Returns a value indicating whether the specified number evaluates to negative or positive infinity.
public:
static bool IsInfinity(double d);
public:
static bool IsInfinity(double d) = System::Numerics::INumberBase<double>::IsInfinity;
public static bool IsInfinity(double d);
static member IsInfinity : double -> bool
Public Shared Function IsInfinity (d As Double) As Boolean
Parameters
A double-precision floating-point number.
Returnstrue
if d
evaluates to PositiveInfinity or NegativeInfinity; otherwise, false
.
The following code example illustrates the use of IsInfinity:
// This will return "true".
Console.WriteLine("IsInfinity(3.0 / 0) == {0}.", Double.IsInfinity(3.0 / 0) ? "true" : "false");
// This will return "true".
printfn $"IsInfinity(3.0 / 0) = %b{Double.IsInfinity(3. / 0.)}."
' This will return "True".
Console.Write("IsInfinity(3.0 / 0) = ")
If Double.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.
See alsoCollaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4