Struct Half
An alias to ushort
packed with a 16-bit floating-point number consisting of a sign bit, a 5-bit biased exponent, and a 10-bit mantissa.
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.DXMath.PackedVector
Assembly: JeremyAnsel.DirectX.DXMath.dll
Syntax
public struct Half : IEquatable<Half>
Remarks
The Half data type is equivalent to the IEEE 754 binary16 format.
Methods
| Edit this page View SourceEquals(Half)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(Half other)
Parameters
Type | Name | Description |
---|---|---|
Half | other | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool |
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceGetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
| Edit this page View SourceToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |
Overrides
Operators
| Edit this page View Sourceoperator ==(Half, Half)
Compares two Half objects. The result specifies whether the values of the two objects are equal.
Declaration
public static bool operator ==(Half left, Half right)
Parameters
Type | Name | Description |
---|---|---|
Half | left | The left Half to compare. |
Half | right | The right Half to compare. |
Returns
Type | Description |
---|---|
bool |
explicit operator Half(double)
Declaration
public static explicit operator Half(double value)
Parameters
Type | Name | Description |
---|---|---|
double | value | The double value. |
Returns
Type | Description |
---|---|
Half | The Half value. |
explicit operator Half(float)
Declaration
public static explicit operator Half(float value)
Parameters
Type | Name | Description |
---|---|---|
float | value | The float value. |
Returns
Type | Description |
---|---|
Half | The Half value. |
implicit operator double(Half)
Declaration
public static implicit operator double(Half value)
Parameters
Type | Name | Description |
---|---|---|
Half | value | The Half value. |
Returns
Type | Description |
---|---|
double | The double value. |
implicit operator float(Half)
Declaration
public static implicit operator float(Half value)
Parameters
Type | Name | Description |
---|---|---|
Half | value | The Half value. |
Returns
Type | Description |
---|---|
float | The float value. |
operator !=(Half, Half)
Compares two Half objects. The result specifies whether the values of the two objects are unequal.
Declaration
public static bool operator !=(Half left, Half right)
Parameters
Type | Name | Description |
---|---|---|
Half | left | The left Half to compare. |
Half | right | The right Half to compare. |
Returns
Type | Description |
---|---|
bool |