aboutsummaryrefslogtreecommitdiff
path: root/std/math/complex/sinh.zig
diff options
context:
space:
mode:
authorMarc Tiehuis <marctiehuis@gmail.com>2018-09-13 20:33:05 +1200
committerMarc Tiehuis <marctiehuis@gmail.com>2018-09-13 20:33:05 +1200
commite70c543bc4c097d7c3287feb0f233a13d4dc3829 (patch)
treeeed3f73ee9e52cbeb801fa85b407b5342d0e26f6 /std/math/complex/sinh.zig
parentafe6316d32d0e61687c58d152207252bdc33dad7 (diff)
downloadzig-e70c543bc4c097d7c3287feb0f233a13d4dc3829.tar.gz
zig-e70c543bc4c097d7c3287feb0f233a13d4dc3829.zip
math/complex: cexp test correction and ldexp usage fix
Diffstat (limited to 'std/math/complex/sinh.zig')
-rw-r--r--std/math/complex/sinh.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/std/math/complex/sinh.zig b/std/math/complex/sinh.zig
index ab23c5c74d..dc19a0ba1b 100644
--- a/std/math/complex/sinh.zig
+++ b/std/math/complex/sinh.zig
@@ -44,7 +44,7 @@ fn sinh32(z: Complex(f32)) Complex(f32) {
else if (ix < 0x4340b1e7) {
const v = Complex(f32).new(math.fabs(x), y);
const r = ldexp_cexp(v, -1);
- return Complex(f32).new(x * math.copysign(f32, 1, x), y);
+ return Complex(f32).new(r.re * math.copysign(f32, 1, x), r.im);
}
// x >= 192.7: result always overflows
else {
@@ -111,7 +111,7 @@ fn sinh64(z: Complex(f64)) Complex(f64) {
else if (ix < 0x4096bbaa) {
const v = Complex(f64).new(math.fabs(x), y);
const r = ldexp_cexp(v, -1);
- return Complex(f64).new(x * math.copysign(f64, 1, x), y);
+ return Complex(f64).new(r.re * math.copysign(f64, 1, x), r.im);
}
// x >= 1455: result always overflows
else {