# operator &

> Returns the result of a componentwise bitwise and operation on two bool2 vectors.

## Definition

* **Type:** Operator
* **Namespace:** [Unity.Mathematics](/engine/6000.5/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule

## operator &(bool2, bool2)

Returns the result of a componentwise bitwise and operation on two bool2 vectors.

```csharp
public static bool2 operator &(bool2 lhs, bool2 rhs)
```

### Parameters

**** (\[bool2]\(/engine/6000.5/script-reference/unity/mathematics/bool2)): Left hand side bool2 to use to compute componentwise bitwise and.**** (\[bool2]\(/engine/6000.5/script-reference/unity/mathematics/bool2)): Right hand side bool2 to use to compute componentwise bitwise and.

### Returns

| Type                                                                | Description                                    |
| ------------------------------------------------------------------- | ---------------------------------------------- |
| [bool2](/engine/6000.5/script-reference/unity/mathematics/bool2.md) | bool2 result of the componentwise bitwise and. |

## operator &(bool2, bool)

Returns the result of a componentwise bitwise and operation on a bool2 vector and a bool value.

```csharp
public static bool2 operator &(bool2 lhs, bool rhs)
```

### Parameters

**** (\[bool2]\(/engine/6000.5/script-reference/unity/mathematics/bool2)): Left hand side bool2 to use to compute componentwise bitwise and.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Right hand side bool to use to compute componentwise bitwise and.

### Returns

| Type                                                                | Description                                    |
| ------------------------------------------------------------------- | ---------------------------------------------- |
| [bool2](/engine/6000.5/script-reference/unity/mathematics/bool2.md) | bool2 result of the componentwise bitwise and. |

## operator &(bool, bool2)

Returns the result of a componentwise bitwise and operation on a bool value and a bool2 vector.

```csharp
public static bool2 operator &(bool lhs, bool2 rhs)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Left hand side bool to use to compute componentwise bitwise and.**** (\[bool2]\(/engine/6000.5/script-reference/unity/mathematics/bool2)): Right hand side bool2 to use to compute componentwise bitwise and.

### Returns

| Type                                                                | Description                                    |
| ------------------------------------------------------------------- | ---------------------------------------------- |
| [bool2](/engine/6000.5/script-reference/unity/mathematics/bool2.md) | bool2 result of the componentwise bitwise and. |
