Struct half
A half precision float that uses 16 bits instead of 32 bits.
Inherited Members
Namespace: Unity.Mathematics
Syntax
[Serializable]
public struct half : IEquatable<half>, IFormattable
Constructors
| Name | Description |
|---|---|
| half(Double) | Constructs a half value from a double value. |
| half(Single) | Constructs a half value from a float value. |
| half(half) | Constructs a half value from a half value. |
Fields
| Name | Description |
|---|---|
| value | The raw 16 bit value of the half. |
| zero | half zero value. |
Properties
| Name | Description |
|---|---|
| MaxValue | The maximum finite half value as a single precision float. |
| MaxValueAsHalf | The maximum finite half value as a half. |
| MinValue | The minimum finite half value as a single precision float. |
| MinValueAsHalf | The minimum finite half value as a half. |
Methods
| Name | Description |
|---|---|
| Equals(Object) | Returns true if the half is equal to a given half, false otherwise. |
| Equals(half) | Returns true if the half is bitwise equivalent to a given half, false otherwise. |
| GetHashCode() | Returns a hash code for the half. |
| ToString() | Returns a string representation of the half. |
| ToString(String, IFormatProvider) | Returns a string representation of the half using a specified format and culture-specific format information. |
Operators
| Name | Description |
|---|---|
| Equality(half, half) | Returns whether two half values are bitwise equivalent. |
| Explicit(Double to half) | Explicitly converts a double value to a half value. |
| Explicit(Single to half) | Explicitly converts a float value to a half value. |
| Implicit(half to Double) | Implicitly converts a half value to a double value. |
| Implicit(half to Single) | Implicitly converts a half value to a float value. |
| Inequality(half, half) | Returns whether two half values are not bitwise equivalent. |