---
name: "BIS_fnc_bitflagsUnset"
type: function
status: ok
groups: ["Bitwise"]
arma3_since: "1.66"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_bitflagsUnset
revid: 328654
updated: 2022-07-13T17:04:22Z
---

# BIS_fnc_bitflagsUnset

*Function · Bitwise · Arma 3 v1.66*

## Description

Unsets one or more flags in the given flagset, represented with decimal or hexadecimal number

(Hexadecimal number representation is simply auto-converted into decimal by the engine)

To check which flags are present in given flagset use [BIS_fnc_bitflagsToArray](../functions/BIS_fnc_bitflagsToArray.md)

**Limitations**:

Due to various limitations of the Real Virtuality engine this function is
intended to work with unsigned 24 bit integers only. This means that the
supported range is 2^0...2^24 (1...16777216)

## Syntax

```sqf
[flagset, flag] call BIS_fnc_bitflagsUnset
```

**Parameters:**

- `flagset`: [Number](../topics/Number.md) - flagset
- `flag`: [Number](../topics/Number.md) - one or more flags to unset

**Returns:** [Number](../topics/Number.md)  - new flagset with given flag or flags unset

## Examples

### Example 1

```sqf
[2 + 4 + 8, 8] call BIS_fnc_bitflagsUnset; // 6 (which is 2 + 4)
[2 + 4 + 8, 2 + 8] call BIS_fnc_bitflagsUnset; // 4
[2 + 4 + 8, 1 + 8] call BIS_fnc_bitflagsUnset; // 6 (which is 2 + 4)
[2 + 4 + 8, 1 + 8 + 8 + 2 + 2] call BIS_fnc_bitflagsUnset; // 10 (which is 2 + 8, since 1 + 8 + 8 + 2 + 2 is in fact 1 + 4 + 16)
```

## See also

[BIS_fnc_bitflagsFlip](../functions/BIS_fnc_bitflagsFlip.md) · [BIS_fnc_bitflagsCheck](../functions/BIS_fnc_bitflagsCheck.md) · [BIS_fnc_bitflagsToArray](../functions/BIS_fnc_bitflagsToArray.md) · [BIS_fnc_bitflagsSet](../functions/BIS_fnc_bitflagsSet.md)

<sub>Source: [BI Community Wiki — BIS fnc bitflagsUnset](https://community.bistudio.com/wiki/BIS_fnc_bitflagsUnset) (revision 328654).</sub>
