Bagikan melalui


Single.IsPositiveInfinity(Single) Metode

Definisi

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

public:
 static bool IsPositiveInfinity(float f);
public:
 static bool IsPositiveInfinity(float f) = System::Numerics::INumberBase<float>::IsPositiveInfinity;
public static bool IsPositiveInfinity (float f);
static member IsPositiveInfinity : single -> bool
Public Shared Function IsPositiveInfinity (f As Single) As Boolean

Parameter

f
Single

Angka floating-point presisi tunggal.

Mengembalikan

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

Penerapan

Contoh

Contoh kode berikut menunjukkan IsPositiveInfinity metode .

// This will return true.
Console::WriteLine( "IsPositiveInfinity(4.0F / 0) == {0}.", Single::IsPositiveInfinity( 4.0F / zero ) ? (String^)"true" : "false" );
// This will return true.
Console.WriteLine("IsPositiveInfinity(4.0F / 0) == {0}.", Single.IsPositiveInfinity(4.0F / 0) ? "true" : "false");
// This will return true.
printfn $"IsPositiveInfinity(4.0F / 0) == {Single.IsPositiveInfinity(4f / 0f)}."
' This will return True.
Console.Write("IsPositiveInfinity(4.0 / 0) = ")
If Single.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