Double.IsPositiveInfinity(Double) 方法

定義

傳回值,指出指定數字是否計算結果為正的無限大。Returns a value indicating whether the specified number evaluates to positive infinity.

public:
 static bool IsPositiveInfinity(double d);
public static bool IsPositiveInfinity (double d);
static member IsPositiveInfinity : double -> bool
Public Shared Function IsPositiveInfinity (d As Double) As Boolean

參數

d
Double

雙精確度浮點數。A double-precision floating-point number.

傳回

如果 d 計算結果為 PositiveInfinity,則為 true;否則為 falsetrue if d evaluates to PositiveInfinity; otherwise, false.

範例

下列程式碼範例說明如何使用 IsPositiveInfinityThe following code example illustrates the use of IsPositiveInfinity:

// This will return S"true".
Console::WriteLine( "IsPositiveInfinity(4.0 / 0) == {0}.", Double::IsPositiveInfinity( 4.0 / zero ) ? (String^)"true" : "false" );
// This will return "true".
Console.WriteLine("IsPositiveInfinity(4.0 / 0) == {0}.", Double.IsPositiveInfinity(4.0 / 0) ? "true" : "false");
' This will return "True".
Console.Write("IsPositiveInfinity(4.0 / 0) = ")
If Double.IsPositiveInfinity(4 / 0) Then
    Console.WriteLine("True.")
Else
    Console.WriteLine("False.")
End If

備註

浮點運算會傳回 PositiveInfinity 以發出溢位條件。Floating-point operations return PositiveInfinity to signal an overflow condition.

適用於

另請參閱