# BitField64

> A 64-bit array of bits.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public struct BitField64
```

## Remarks

Stack allocated, so it does not require thread safety checks or disposal.

## Fields

| Value                                                                          | Description                     |
| ------------------------------------------------------------------------------ | ------------------------------- |
| [Value](/engine/6000.7/script-reference/unity/collections/bitfield64/value.md) | The 64 bits, stored as a ulong. |

## Constructors

| Constructor                                                                                       | Description                                        |
| ------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| [BitField64(System.UInt64)](/engine/6000.7/script-reference/unity/collections/bitfield64/ctor.md) | Initializes and returns an instance of BitField64. |

## Methods

| Method                                                                                                   | Description                                                                          |
| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [Clear](/engine/6000.7/script-reference/unity/collections/bitfield64/clear.md)                           | Clears all bits to 0.                                                                |
| [CountBits](/engine/6000.7/script-reference/unity/collections/bitfield64/countbits.md)                   | Returns the number of bits that are 1.                                               |
| [CountLeadingZeros](/engine/6000.7/script-reference/unity/collections/bitfield64/countleadingzeros.md)   | Returns the number of leading zeroes.                                                |
| [CountTrailingZeros](/engine/6000.7/script-reference/unity/collections/bitfield64/counttrailingzeros.md) | Returns the number of trailing zeros.                                                |
| [GetBits](/engine/6000.7/script-reference/unity/collections/bitfield64/getbits.md)                       | Returns one or more contiguous bits from the bit field as the lower bits of a ulong. |
| [IsSet](/engine/6000.7/script-reference/unity/collections/bitfield64/isset.md)                           | Returns true if the bit at a position is 1.                                          |
| [SetBits](/engine/6000.7/script-reference/unity/collections/bitfield64/setbits.md)                       | Sets a single bit to 1 or 0.                                                         |
| [TestAll](/engine/6000.7/script-reference/unity/collections/bitfield64/testall.md)                       | Returns true if all of the bits in a contiguous range are 1.                         |
| [TestAny](/engine/6000.7/script-reference/unity/collections/bitfield64/testany.md)                       | Returns true if any of the bits in a contiguous range are 1.                         |
| [TestNone](/engine/6000.7/script-reference/unity/collections/bitfield64/testnone.md)                     | Returns true if none of the bits in a contiguous range are 1.                        |
