{"name":"BIS_fnc_bitflagsCheck","title":"BIS fnc bitflagsCheck","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_bitflagsCheck","revid":329417,"updated":"2022-07-27T15:28:10Z","groups":["Bitwise"],"status":"ok","games":{"arma3":"1.66"},"since":"arma3 1.66","arma3_since":"1.66","description":"Checks if one or more flags are set in the given flagset, represented with decimal or hexadecimal number\n(Hexadecimal number representation is simply auto-converted into decimal by the engine)\nIn other words, it simply performs a bitwise AND (&) operation on the two numbers: `flags & flagset > 0`\nTo check which flags are present in given flagset use BIS_fnc_bitflagsToArray","syntaxes":[{"syntax":"[flagset, flag] call BIS_fnc_bitflagsCheck","params":[{"name":"flagset","type":"Number","description":"flagset","type_expr":"Number"},{"name":"flag","type":"Number","description":"one or more flags to check","type_expr":"Number"}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"- true: one or more flags are set in given flagset - false: no given flag or flags are set in the given flagset","text":"Boolean\n\n- true: one or more flags are set in given flagset\n- false: no given flag or flags are set in the given flagset"}}],"examples":[{"code":["[2 + 4 + 8, 8] call BIS_fnc_bitflagsCheck; // true\n[2 + 4 + 8, 2 + 32] call BIS_fnc_bitflagsCheck; // true\n[2 + 4 + 8, 1] call BIS_fnc_bitflagsCheck; // false\n[2 + 4 + 8, 1 + 32] call BIS_fnc_bitflagsCheck; // false"]}],"problems":"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).","see_also":["BIS_fnc_bitflagsFlip","BIS_fnc_bitflagsSet","BIS_fnc_bitflagsToArray","BIS_fnc_bitflagsUnset"]}