mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
14 lines
285 B
Zig
14 lines
285 B
Zig
const print = @import("std").debug.print;
|
|
pub fn main() void {
|
|
const byte: u8 = 255;
|
|
|
|
const ov = @addWithOverflow(byte, 10);
|
|
if (ov[1] != 0) {
|
|
print("overflowed result: {}\n", .{ov[0]});
|
|
} else {
|
|
print("result: {}\n", .{ov[0]});
|
|
}
|
|
}
|
|
|
|
// exe=succeed
|