update more of the std lib to use @as
This commit is contained in:
@@ -133,8 +133,8 @@ test "complex.div" {
|
||||
const b = Complex(f32).new(2, 7);
|
||||
const c = a.div(b);
|
||||
|
||||
testing.expect(math.approxEq(f32, c.re, f32(31) / 53, epsilon) and
|
||||
math.approxEq(f32, c.im, f32(-29) / 53, epsilon));
|
||||
testing.expect(math.approxEq(f32, c.re, @as(f32, 31) / 53, epsilon) and
|
||||
math.approxEq(f32, c.im, @as(f32, -29) / 53, epsilon));
|
||||
}
|
||||
|
||||
test "complex.conjugate" {
|
||||
@@ -148,8 +148,8 @@ test "complex.reciprocal" {
|
||||
const a = Complex(f32).new(5, 3);
|
||||
const c = a.reciprocal();
|
||||
|
||||
testing.expect(math.approxEq(f32, c.re, f32(5) / 34, epsilon) and
|
||||
math.approxEq(f32, c.im, f32(-3) / 34, epsilon));
|
||||
testing.expect(math.approxEq(f32, c.re, @as(f32, 5) / 34, epsilon) and
|
||||
math.approxEq(f32, c.im, @as(f32, -3) / 34, epsilon));
|
||||
}
|
||||
|
||||
test "complex.magnitude" {
|
||||
|
||||
Reference in New Issue
Block a user