aboutsummaryrefslogtreecommitdiff
path: root/std/math/ceil.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/ceil.zig
parent799c69910172a7248ab9db366e6e3a6556e7d626 (diff)
downloadzig-c9fc8bd802f5ed52c4cc78b93f18fc5dc9b6bb7f.tar.gz
zig-c9fc8bd802f5ed52c4cc78b93f18fc5dc9b6bb7f.zip
workaround for llvm bug
See #393 for details
Diffstat (limited to 'std/math/ceil.zig')
-rw-r--r--std/math/ceil.zig11
1 files changed, 7 insertions, 4 deletions
diff --git a/std/math/ceil.zig b/std/math/ceil.zig
index f80e493f1f..f5bc22500a 100644
--- a/std/math/ceil.zig
+++ b/std/math/ceil.zig
@@ -2,7 +2,10 @@ const builtin = @import("builtin");
const math = @import("index.zig");
const assert = @import("../debug.zig").assert;
-pub fn ceil(x: var) -> @typeOf(x) {
+// TODO issue #393
+pub const ceil = ceil_workaround;
+
+pub fn ceil_workaround(x: var) -> @typeOf(x) {
const T = @typeOf(x);
switch (T) {
f32 => @inlineCall(ceil32, x),
@@ -71,18 +74,18 @@ fn ceil64(x: f64) -> f64 {
}
}
-test "ceil" {
+test "math.ceil" {
assert(ceil(f32(0.0)) == ceil32(0.0));
assert(ceil(f64(0.0)) == ceil64(0.0));
}
-test "ceil32" {
+test "math.ceil32" {
assert(ceil32(1.3) == 2.0);
assert(ceil32(-1.3) == -1.0);
assert(ceil32(0.2) == 1.0);
}
-test "ceil64" {
+test "math.ceil64" {
assert(ceil64(1.3) == 2.0);
assert(ceil64(-1.3) == -1.0);
assert(ceil64(0.2) == 1.0);