zig/doc/langref/test_round_builtin.zig

11 lines
214 B
Zig
Raw Normal View History

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