Single.IsNegativeInfinity(Single) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
傳回值,指出指定的數字是否計算結果為負的無限大。
public:
static bool IsNegativeInfinity(float f);
public:
static bool IsNegativeInfinity(float f) = System::Numerics::INumberBase<float>::IsNegativeInfinity;
public static bool IsNegativeInfinity (float f);
static member IsNegativeInfinity : single -> bool
Public Shared Function IsNegativeInfinity (f As Single) As Boolean
參數
- f
- Single
單精確度浮點數。
傳回
如果 f
計算結果為 NegativeInfinity,則為 true
;否則為 false
。
實作
範例
下列程式碼範例示範 IsNegativeInfinity 方法。
// This will return true.
Console::WriteLine( "IsNegativeInfinity(-5.0F / 0) == {0}.", Single::IsNegativeInfinity( -5.0F / zero ) ? (String^)"true" : "false" );
// This will return true.
Console.WriteLine("IsNegativeInfinity(-5.0F / 0) == {0}.", Single.IsNegativeInfinity(-5.0F / 0) ? "true" : "false");
// This will return true.
printfn $"IsNegativeInfinity(-5.0F / 0) == {Single.IsNegativeInfinity(-5f / 0f)}."
' This will return True.
Console.Write("IsNegativeInfinity(-5.0 / 0) = ")
If Single.IsNegativeInfinity(-5 / 0) Then
Console.WriteLine("True.")
Else
Console.WriteLine("False.")
End If
備註
浮點運算會返回 NegativeInfinity 以發出溢位狀況的訊號。
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應