mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
eb7f318ea8
A test has also been added to demonstrate the expected behavior. * std.math: update round doc comment to match the builtin
11 lines
214 B
Zig
11 lines
214 B
Zig
const expect = @import("std").testing.expect;
|
|
|
|
test "@round" {
|
|
try expect(@round(1.4) == 1);
|
|
try expect(@round(1.5) == 2);
|
|
try expect(@round(-1.4) == -1);
|
|
try expect(@round(-2.5) == -3);
|
|
}
|
|
|
|
// test
|