aboutsummaryrefslogtreecommitdiff
path: root/std/math/asin.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-06-19 14:36:33 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-06-19 14:36:33 -0400
commitc9fc8bd802f5ed52c4cc78b93f18fc5dc9b6bb7f (patch)
tree8ddb992d7c1b4ede1b6a99e32fad16c1a476e0c1 /std/math/asin.zig
parent799c69910172a7248ab9db366e6e3a6556e7d626 (diff)
downloadzig-c9fc8bd802f5ed52c4cc78b93f18fc5dc9b6bb7f.tar.gz
zig-c9fc8bd802f5ed52c4cc78b93f18fc5dc9b6bb7f.zip
workaround for llvm bug
See #393 for details
Diffstat (limited to 'std/math/asin.zig')
-rw-r--r--std/math/asin.zig15
1 files changed, 9 insertions, 6 deletions
diff --git a/std/math/asin.zig b/std/math/asin.zig
index e671477b3c..be8d006cac 100644
--- a/std/math/asin.zig
+++ b/std/math/asin.zig
@@ -1,7 +1,10 @@
const math = @import("index.zig");
const assert = @import("../debug.zig").assert;
-pub fn asin(x: var) -> @typeOf(x) {
+pub const asin = asin_workaround;
+
+// TODO issue #393
+pub fn asin_workaround(x: var) -> @typeOf(x) {
const T = @typeOf(x);
switch (T) {
f32 => @inlineCall(asin32, x),
@@ -129,12 +132,12 @@ fn asin64(x: f64) -> f64 {
}
}
-test "asin" {
- assert(asin(f32(0.0)) == asin32(0.0));
- assert(asin(f64(0.0)) == asin64(0.0));
+test "math.asin" {
+ assert(asin_workaround(f32(0.0)) == asin32(0.0));
+ assert(asin_workaround(f64(0.0)) == asin64(0.0));
}
-test "asin32" {
+test "math.asin32" {
const epsilon = 0.000001;
assert(math.approxEq(f32, asin32(0.0), 0.0, epsilon));
@@ -145,7 +148,7 @@ test "asin32" {
assert(math.approxEq(f32, asin32(0.8923), 1.102415, epsilon));
}
-test "asin64" {
+test "math.asin64" {
const epsilon = 0.000001;
assert(math.approxEq(f64, asin64(0.0), 0.0, epsilon));