Bagikan melalui


Double.IsPositiveInfinity(Double) Metode

Definisi

Mengembalikan nilai yang menunjukkan apakah angka yang ditentukan mengevaluasi ke tak terbatas positif.

public:
 static bool IsPositiveInfinity(double d);
public:
 static bool IsPositiveInfinity(double d) = System::Numerics::INumberBase<double>::IsPositiveInfinity;
public static bool IsPositiveInfinity (double d);
static member IsPositiveInfinity : double -> bool
Public Shared Function IsPositiveInfinity (d As Double) As Boolean

Parameter

d
Double

Angka floating-point presisi ganda.

Mengembalikan

true jika d mengevaluasi ke PositiveInfinity; jika tidak, false.

Penerapan

Contoh

Contoh kode berikut mengilustrasikan penggunaan 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".
printfn $"IsPositiveInfinity(4.0 / 0) = %b{Double.IsPositiveInfinity(4. / 0.)}."
' 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

Keterangan

Operasi floating-point kembali PositiveInfinity untuk memberi sinyal kondisi luapan.

Berlaku untuk

Lihat juga