| ... | @@ -482,7 +482,16 @@ fn testAbsInt() void { | ... | @@ -482,7 +482,16 @@ fn testAbsInt() void { |
| 482 | testing.expect((absInt(i32(10)) catch unreachable) == 10); | 482 | testing.expect((absInt(i32(10)) catch unreachable) == 10); |
| 483 | } | 483 | } |
| 484 | | 484 | |
| 485 | pub const absFloat = @import("fabs.zig").fabs; | 485 | pub const absFloat = fabs; |
| | 486 | |
| | 487 | test "math.absFloat" { |
| | 488 | testAbsFloat(); |
| | 489 | comptime testAbsFloat(); |
| | 490 | } |
| | 491 | fn testAbsFloat() void { |
| | 492 | testing.expect(absFloat(f32(-10.05)) == 10.05); |
| | 493 | testing.expect(absFloat(f32(10.05)) == 10.05); |
| | 494 | } |
| 486 | | 495 | |
| 487 | pub fn divTrunc(comptime T: type, numerator: T, denominator: T) !T { | 496 | pub fn divTrunc(comptime T: type, numerator: T, denominator: T) !T { |
| 488 | @setRuntimeSafety(false); | 497 | @setRuntimeSafety(false); |