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) |
比较此实例与 |
Equals(Object) |
返回指示此实例是否与指定的 |
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) |
返回一个值,该值指示 |
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. |