Skip to content

Commit ea8026c

Browse files
committed
test rounding
1 parent 51cdc96 commit ea8026c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

f_to_c/src/main.zig

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ fn convert_to_celsius(fahrenheit: f32) f32 {
1111

1212
test "convert fahrenheit to celsius" {
1313
try std.testing.expectEqual(0.0, convert_to_celsius(32));
14-
try std.testing.expectApproxEqAbs(-0.888888, convert_to_celsius(30.4), 0.000001);
14+
try std.testing.expectApproxEqAbs(-0.888888, convert_to_celsius(30.4), 0.001);
1515
try std.testing.expectEqual(-40.0, convert_to_celsius(-40));
1616
try std.testing.expectApproxEqAbs(100, convert_to_celsius(212), 0.000001);
17-
try std.testing.expectApproxEqAbs(-273.15, convert_to_celsius(-459.67), 0.000001);
17+
try std.testing.expectApproxEqAbs(-273.15, convert_to_celsius(-459.67), 0.001);
1818
}
1919

2020
// l takes a record that contains a temperature and a unit f.i. 30.0 F

0 commit comments

Comments
 (0)