mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 00:26:57 +00:00
Fix absFloat
This commit is contained in:
parent
60b1cf2a83
commit
2cbcf3f38b
11
std/math.zig
11
std/math.zig
@ -482,7 +482,16 @@ fn testAbsInt() void {
|
||||
testing.expect((absInt(i32(10)) catch unreachable) == 10);
|
||||
}
|
||||
|
||||
pub const absFloat = @import("fabs.zig").fabs;
|
||||
pub const absFloat = fabs;
|
||||
|
||||
test "math.absFloat" {
|
||||
testAbsFloat();
|
||||
comptime testAbsFloat();
|
||||
}
|
||||
fn testAbsFloat() void {
|
||||
testing.expect(absFloat(f32(-10.05)) == 10.05);
|
||||
testing.expect(absFloat(f32(10.05)) == 10.05);
|
||||
}
|
||||
|
||||
pub fn divTrunc(comptime T: type, numerator: T, denominator: T) !T {
|
||||
@setRuntimeSafety(false);
|
||||
|
Loading…
Reference in New Issue
Block a user