diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-06-19 14:36:33 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-06-19 14:36:33 -0400 |
| commit | c9fc8bd802f5ed52c4cc78b93f18fc5dc9b6bb7f (patch) | |
| tree | 8ddb992d7c1b4ede1b6a99e32fad16c1a476e0c1 /std/math/asin.zig | |
| parent | 799c69910172a7248ab9db366e6e3a6556e7d626 (diff) | |
| download | zig-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.zig | 15 |
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)); |
