mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
17 lines
301 B
Zig
17 lines
301 B
Zig
pub fn main() void {
|
|
var i: u32 = 10;
|
|
var j: u32 = 11;
|
|
assert(i | 1 == 11);
|
|
assert(j | 1 == 11);
|
|
var m1: u32 = 0b1111;
|
|
var m2: u32 = 0b0000;
|
|
assert(m1 | 0b1010 == 0b1111);
|
|
assert(m2 | 0b1010 == 0b1010);
|
|
}
|
|
fn assert(b: bool) void {
|
|
if (!b) unreachable;
|
|
}
|
|
|
|
// run
|
|
//
|