aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math/complex/tan.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/tan.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/tan.zig')
-rw-r--r--lib/std/math/complex/tan.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/math/complex/tan.zig b/lib/std/math/complex/tan.zig
index ca9d4ce7e9..0ee34dfcc2 100644
--- a/lib/std/math/complex/tan.zig
+++ b/lib/std/math/complex/tan.zig
@@ -12,15 +12,15 @@ const Complex = cmath.Complex;
/// Returns the tanget of z.
pub fn tan(z: anytype) Complex(@TypeOf(z.re)) {
const T = @TypeOf(z.re);
- const q = Complex(T).new(-z.im, z.re);
+ const q = Complex(T).init(-z.im, z.re);
const r = cmath.tanh(q);
- return Complex(T).new(r.im, -r.re);
+ return Complex(T).init(r.im, -r.re);
}
const epsilon = 0.0001;
test "complex.ctan" {
- const a = Complex(f32).new(5, 3);
+ const a = Complex(f32).init(5, 3);
const c = tan(a);
try testing.expect(math.approxEqAbs(f32, c.re, -0.002708233, epsilon));