mirror of
https://github.com/ziglang/zig.git
synced 2025-12-07 06:43:07 +00:00
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
22 lines
846 B
Zig
22 lines
846 B
Zig
const __divti3 = @import("divti3.zig").__divti3;
|
|
const testing = @import("std").testing;
|
|
|
|
fn test__divti3(a: i128, b: i128, expected: i128) !void {
|
|
const x = __divti3(a, b);
|
|
try testing.expect(x == expected);
|
|
}
|
|
|
|
test "divti3" {
|
|
try test__divti3(0, 1, 0);
|
|
try test__divti3(0, -1, 0);
|
|
try test__divti3(2, 1, 2);
|
|
try test__divti3(2, -1, -2);
|
|
try test__divti3(-2, 1, -2);
|
|
try test__divti3(-2, -1, 2);
|
|
|
|
try test__divti3(@bitCast(i128, @as(u128, 0x8 << 124)), 1, @bitCast(i128, @as(u128, 0x8 << 124)));
|
|
try test__divti3(@bitCast(i128, @as(u128, 0x8 << 124)), -1, @bitCast(i128, @as(u128, 0x8 << 124)));
|
|
try test__divti3(@bitCast(i128, @as(u128, 0x8 << 124)), -2, @bitCast(i128, @as(u128, 0x4 << 124)));
|
|
try test__divti3(@bitCast(i128, @as(u128, 0x8 << 124)), 2, @bitCast(i128, @as(u128, 0xc << 124)));
|
|
}
|