bit_or
lib callCapy
function bit_or(a : s8, b : s8) s8 function bit_or(a : s16, b : s16) s16 function bit_or(a : s32, b : s32) s32 function bit_or(a : s64, b : s64) s64 function bit_or(a : u8, b : u8) u8 function bit_or(a : u16, b : u16) u16 function bit_or(a : u32, b : u32) u32 function bit_or(a : u64, b : u64) u64
Description
bit_or() combines flags: bit_or(flags, u8(4)) sets bit 2.
Parameters
a : the first integer
b : the second integer, in the same type
Return Values
An integer with a bit set where either input has it, in their type.
Example
Capy
var flags := u8(2) flags = bit_or(flags, u8(4)) print(flags, " ", bit_or(12, 10), "\n")
Output
6 14