# half

> A half precision float that uses 16 bits instead of 32 bits.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Mathematics](/engine/6000.7/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule
* **Implements:** [IEquatable\<half>](https://learn.microsoft.com/dotnet/api/system.iequatable-1), [IFormattable](https://learn.microsoft.com/dotnet/api/system.iformattable)

```csharp
public struct half : IEquatable<half>, IFormattable
```

## Fields

| Value                                                                    | Description                       |
| ------------------------------------------------------------------------ | --------------------------------- |
| [value](/engine/6000.7/script-reference/unity/mathematics/half/value.md) | The raw 16 bit value of the half. |

## Static Fields

| Value                                                                  | Description      |
| ---------------------------------------------------------------------- | ---------------- |
| [zero](/engine/6000.7/script-reference/unity/mathematics/half/zero.md) | half zero value. |

## Constructors

| Constructor                                                                                                 | Description                                  |
| ----------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| [half(System.Double)](/engine/6000.7/script-reference/unity/mathematics/half/ctor.md#half\(double\))        | Constructs a half value from a double value. |
| [half(System.Single)](/engine/6000.7/script-reference/unity/mathematics/half/ctor.md#half\(float\))         | Constructs a half value from a float value.  |
| [half(Unity.Mathematics.half)](/engine/6000.7/script-reference/unity/mathematics/half/ctor.md#half\(half\)) | Constructs a half value from a half value.   |

## Static Properties

| Property                                                                                   | Description                                                |
| ------------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
| [MaxValue](/engine/6000.7/script-reference/unity/mathematics/half/maxvalue.md)             | The maximum finite half value as a single precision float. |
| [MaxValueAsHalf](/engine/6000.7/script-reference/unity/mathematics/half/maxvalueashalf.md) | The maximum finite half value as a half.                   |
| [MinValue](/engine/6000.7/script-reference/unity/mathematics/half/minvalue.md)             | The minimum finite half value as a single precision float. |
| [MinValueAsHalf](/engine/6000.7/script-reference/unity/mathematics/half/minvalueashalf.md) | The minimum finite half value as a half.                   |

## Methods

| Method                                                                               | Description                                                         |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------- |
| [Equals](/engine/6000.7/script-reference/unity/mathematics/half/equals.md)           | Returns true if the half is equal to a given half, false otherwise. |
| [GetHashCode](/engine/6000.7/script-reference/unity/mathematics/half/gethashcode.md) | Returns a hash code for the half.                                   |
| [ToString](/engine/6000.7/script-reference/unity/mathematics/half/tostring.md)       | Returns a string representation of the half.                        |

## Operators

| Operator                                                                               | Description                                                 |
| -------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| [operator ==](/engine/6000.7/script-reference/unity/mathematics/half/op-equality.md)   | Returns whether two half values are bitwise equivalent.     |
| [half](/engine/6000.7/script-reference/unity/mathematics/half/op-explicit.md)          | Explicitly converts a double value to a half value.         |
| [double](/engine/6000.7/script-reference/unity/mathematics/half/op-implicit.md)        | Implicitly converts a half value to a double value.         |
| [float](/engine/6000.7/script-reference/unity/mathematics/half/op-implicit.md)         | Implicitly converts a half value to a float value.          |
| [operator !=](/engine/6000.7/script-reference/unity/mathematics/half/op-inequality.md) | Returns whether two half values are not bitwise equivalent. |
