Double.IsInfinity(Double) メソッド
定義
指定した数値が負または正の無限大と評価されるかどうかを示す値を返します。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);
static member IsInfinity : double -> bool
Public Shared Function IsInfinity (d As Double) As Boolean
パラメーター
- d
- Double
倍精度浮動小数点数。A double-precision floating-point number.
戻り値
d
が PositiveInfinity または NegativeInfinity と評価される場合は true
。それ以外の場合は false
。true
if d
evaluates to PositiveInfinity or NegativeInfinity; otherwise, false
.
例
次のコード例は、の使用方法を示してい IsInfinity ます。The following code example illustrates the use of IsInfinity:
// This will return S"true".
Console::WriteLine( "IsInfinity(3.0 / 0) == {0}.", Double::IsInfinity( 3.0 / zero ) ? (String^)"true" : "false" );
// This will return "true".
Console.WriteLine("IsInfinity(3.0 / 0) == {0}.", Double.IsInfinity(3.0 / 0) ? "true" : "false");
' 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
注釈
浮動小数点演算で PositiveInfinity は、 NegativeInfinity オーバーフロー状態を通知するためにまたはが返されます。Floating-point operations return PositiveInfinity or NegativeInfinity to signal an overflow condition.