aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math/complex/asin.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-05-17 19:30:38 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-05-17 19:30:38 -0700
commit615d45da779842715a3ab65b59233e9cfb4fa122 (patch)
tree9c269e8fa9beded00954d82ebc0c95d56c485322 /lib/std/math/complex/asin.zig
parent1d3f76bbda90f810a24845c15516235d91ee12ad (diff)
parent0dd0c9620d66afcfabaf3dcb21b636530fd0ccba (diff)
downloadzig-615d45da779842715a3ab65b59233e9cfb4fa122.tar.gz
zig-615d45da779842715a3ab65b59233e9cfb4fa122.zip
Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen
Conflicts: * src/codegen/spirv.zig * src/link/SpirV.zig We're going to want to improve the stage2 test harness to print the source file name when a compile error occurs otherwise std lib contributors are going to see some confusing CI failures when they cause stage2 AstGen compile errors.
Diffstat (limited to 'lib/std/math/complex/asin.zig')
-rw-r--r--lib/std/math/complex/asin.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/math/complex/asin.zig b/lib/std/math/complex/asin.zig
index 7ce200fae2..f2c377df56 100644
--- a/lib/std/math/complex/asin.zig
+++ b/lib/std/math/complex/asin.zig
@@ -15,17 +15,17 @@ pub fn asin(z: anytype) Complex(@TypeOf(z.re)) {
const x = z.re;
const y = z.im;
- const p = Complex(T).new(1.0 - (x - y) * (x + y), -2.0 * x * y);
- const q = Complex(T).new(-y, x);
+ const p = Complex(T).init(1.0 - (x - y) * (x + y), -2.0 * x * y);
+ const q = Complex(T).init(-y, x);
const r = cmath.log(q.add(cmath.sqrt(p)));
- return Complex(T).new(r.im, -r.re);
+ return Complex(T).init(r.im, -r.re);
}
const epsilon = 0.0001;
test "complex.casin" {
- const a = Complex(f32).new(5, 3);
+ const a = Complex(f32).init(5, 3);
const c = asin(a);
try testing.expect(math.approxEqAbs(f32, c.re, 1.023822, epsilon));