Half 結構

定義

符合 IEEE 754 規範的 float16 類型。An IEEE 754 compliant float16 type.

public value class Half : IComparable, IComparable<Half>, IEquatable<Half>, IFormattable
public struct Half : IComparable, IComparable<Half>, IEquatable<Half>, IFormattable
type Half = struct
    interface IFormattable
Public Structure Half
Implements IComparable, IComparable(Of Half), IEquatable(Of Half), IFormattable
繼承
實作

屬性

Epsilon

代表大於零的最小正 Half 值。Represents the smallest positive Half value that is greater than zero.

MaxValue

代表 Half 最大的可能值。Represents the largest possible value of Half.

MinValue

代表 Half 最小的可能值。Represents the smallest possible value of Half.

NaN

代表非數值。Represents not a number.

NegativeInfinity

表示負無限大。Represents negative infinity.

PositiveInfinity

表示正無限大。Represents positive infinity.

方法

CompareTo(Half)

將這個執行個體與指定的半精確度浮點數進行比較,並傳回整數,這個整數表示這個執行個體的值是小於、等於或大於指定的半精確度浮點數。Compares this instance to a specified half-precision floating-point number and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified half-precision floating-point number.

CompareTo(Object)

比較這個執行個體與特定物件,並且傳回一個整數,指出這個執行個體的值是小於、等於或大於特定物件的值。Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object.

Equals(Half)

將這個執行個體與 other 進行相等比較。Compares this instance for equality with other.

Equals(Object)

傳回值,這個值表示這個執行個體是否等於指定的 objReturns a value that indicates whether this instance is equal to the specified obj.

GetHashCode()

傳回這個執行個體的雜湊碼。Returns the hash code for this instance.

IsFinite(Half)

判斷指定的值是否為有限 (零、偏低或一般)。Determines whether the specified value is finite (zero, subnormal, or normal).

IsInfinity(Half)

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

IsNaN(Half)

判斷指定的值是否為數字。Determines whether the specified value is not a number.

IsNegative(Half)

判斷指定的值是否為負數。Determines whether the specified value is negative.

IsNegativeInfinity(Half)

判斷指定的值是否為負無限大。Determines whether the specified value is negative infinity.

IsNormal(Half)

判斷指定的值是否為正常。Determines whether the specified value is normal.

IsPositiveInfinity(Half)

判斷指定的值是否為正無限大。Determines whether the specified value is positive infinity.

IsSubnormal(Half)

判斷指定的值是否為偏低。Determines whether the specified value is subnormal.

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

將數字的字串表示 (使用指定樣式和的特定文化特性格式) 轉換為其對等單精確度浮點數。Converts the string representation of a number in a specified style and culture-specific format to its single-precision floating-point number equivalent.

Parse(String)

將數字的字串表示法轉換為其對等半精確度浮點數。Converts the string representation of a number to its half-precision floating-point number equivalent.

Parse(String, IFormatProvider)

將數字的字串表示 (使用指定的特定文化特性格式) 轉換為其對等單精確度浮點數。Converts the string representation of a number in a specified culture-specific format to its single-precision floating-point number equivalent.

Parse(String, NumberStyles)

將數字的字串表示 (使用指定樣式) 轉換為其對等單精確度浮點數。Converts the string representation of a number in a specified style to its single-precision floating-point number equivalent.

Parse(String, NumberStyles, IFormatProvider)

將數字的字串表示 (使用指定樣式和的特定文化特性格式) 轉換為其對等單精確度浮點數。Converts the string representation of a number in a specified style and culture-specific format to its single-precision floating-point number equivalent.

ToString()

將這個執行個體的數值轉換為其相等字串表示。Converts the numeric value of this instance to its equivalent string representation.

ToString(IFormatProvider)

使用指定的特定文化特性格式資訊,將這個執行個體的數值轉換成它的相等字串表示。Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.

ToString(String)

使用指定格式,將這個執行個體的數值轉換成它的相等字串表示。Converts the numeric value of this instance to its equivalent string representation, using the specified format.

ToString(String, IFormatProvider)

使用指定的格式和特定文化特性格式資訊,將這個執行個體的數值轉換成它的相等字串表示。Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.

TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)

嘗試將目前 Half 執行個體的值格式化為所提供字元範圍。Tries to format the value of the current Half instance into the provided span of characters.

TryParse(ReadOnlySpan<Char>, Half)

將數字的範圍表示法轉換為其對等半精確度浮點數。Converts the span representation of a number to its half-precision floating-point number equivalent. 傳回值,該值指出轉換成功或失敗。A return value indicates whether the conversion succeeded or failed.

TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, Half)

將數字的範圍表示法轉換為其對等半精確度浮點數。Converts the span representation of a number to its half-precision floating-point number equivalent. 傳回值,該值指出轉換成功或失敗。A return value indicates whether the conversion succeeded or failed.

TryParse(String, Half)

將數字的字串表示法轉換為其對等半精確度浮點數。Converts the string representation of a number to its half-precision floating-point number equivalent. 傳回值,該值指出轉換成功或失敗。A return value indicates whether the conversion succeeded or failed.

TryParse(String, NumberStyles, IFormatProvider, Half)

將數字的字串表示法轉換為其對等半精確度浮點數。Converts the string representation of a number to its half-precision floating-point number equivalent. 傳回值,該值指出轉換成功或失敗。A return value indicates whether the conversion succeeded or failed.

運算子

Equality(Half, Half)

傳回值,該值表示兩個指定的 Half 值是否相等。Returns a value that indicates whether two specified Half values are equal.

Explicit(Double to Half)

Double 值轉換為 Half 的明確運算子。An explicit operator to convert a Double value to a Half.

Explicit(Half to Double)

Half 值轉換為 Double 的明確運算子。An explicit operator to convert a Half value to a Double.

Explicit(Half to Single)

Half 值轉換為 Single 的明確運算子。An explicit operator to convert a Half value to a Single.

Explicit(Single to Half)

Single 值轉換為 Half 的明確運算子。An explicit operator to convert a Single value to a Half.

GreaterThan(Half, Half)

傳回值,該值表示指定的 Half 值是否大於另一個指定的 Half 值。Returns a value that indicates whether a specified Half value is greater than another specified Half value.

GreaterThanOrEqual(Half, Half)

傳回值,這個值表示 left 是否大於或等於 rightReturns a value that indicates whether left is greater than or equal to right.

Inequality(Half, Half)

傳回值,該值表示兩個指定的 Half 值是否不相等。Returns a value that indicates whether two specified Half values are not equal.

LessThan(Half, Half)

傳回值,該值表示指定的 Half 值是否小於另一個指定的 Half 值。Returns a value that indicates whether a specified Half value is less than another specified Half value.

LessThanOrEqual(Half, Half)

傳回值,該值表示指定的 Half 值是否小於或等於另一個指定的 Half 值。Returns a value that indicates whether a specified Half value is less than or equal to another specified Half value.

適用於