From b8ed0cb3741533e036ee05faa165d2f0c49064f4 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 28 Aug 2017 04:28:42 -0400 Subject: [PATCH] remove workaround for LLVM not respecting "nobuiltin" now that we depend on LLVM 5.0.0 we can remove the workaround. closes #393 --- std/math/acos.zig | 9 +++------ std/math/acosh.zig | 9 +++------ std/math/asin.zig | 9 +++------ std/math/asinh.zig | 9 +++------ std/math/atan.zig | 9 +++------ std/math/atan2.zig | 9 +++------ std/math/atanh.zig | 5 +---- std/math/cbrt.zig | 5 +---- std/math/ceil.zig | 5 +---- std/math/copysign.zig | 5 +---- std/math/cos.zig | 5 +---- std/math/cosh.zig | 5 +---- std/math/exp.zig | 5 +---- std/math/exp2.zig | 5 +---- std/math/expm1.zig | 5 +---- std/math/fabs.zig | 5 +---- std/math/floor.zig | 5 +---- std/math/fma.zig | 5 +---- std/math/frexp.zig | 5 +---- std/math/hypot.zig | 5 +---- std/math/ilogb.zig | 5 +---- std/math/ln.zig | 4 +--- std/math/log.zig | 5 +---- std/math/log10.zig | 5 +---- std/math/log1p.zig | 5 +---- std/math/log2.zig | 5 +---- std/math/modf.zig | 5 +---- std/math/nan.zig | 8 ++------ std/math/pow.zig | 5 +---- std/math/round.zig | 5 +---- std/math/scalbn.zig | 5 +---- std/math/signbit.zig | 5 +---- std/math/sin.zig | 5 +---- std/math/sinh.zig | 5 +---- std/math/sqrt.zig | 5 +---- std/math/tan.zig | 4 +--- std/math/tanh.zig | 5 +---- std/math/trunc.zig | 4 +--- 38 files changed, 51 insertions(+), 163 deletions(-) diff --git a/std/math/acos.zig b/std/math/acos.zig index 9d09b628cbeb11a7ffef6da04af41fde67c61981..941643db829eecf12d780ba13b5c8e64a96ac339 100644 --- a/std/math/acos.zig +++ b/std/math/acos.zig @@ -5,10 +5,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -pub const acos = acos_workaround; - -// TODO issue #393 -pub fn acos_workaround(x: var) -> @typeOf(x) { +pub fn acos(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(acos32, x), @@ -145,8 +142,8 @@ fn acos64(x: f64) -> f64 { } test "math.acos" { - assert(acos_workaround(f32(0.0)) == acos32(0.0)); - assert(acos_workaround(f64(0.0)) == acos64(0.0)); + assert(acos(f32(0.0)) == acos32(0.0)); + assert(acos(f64(0.0)) == acos64(0.0)); } test "math.acos32" { diff --git a/std/math/acosh.zig b/std/math/acosh.zig index 16c869f5f60e1e178b647f31406198dc2c6437d3..4c14837faa0dd791e05dba1d664b1dfd179d537c 100644 --- a/std/math/acosh.zig +++ b/std/math/acosh.zig @@ -6,10 +6,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -pub const acosh = acosh_workaround; - -// TODO issue #393 -pub fn acosh_workaround(x: var) -> @typeOf(x) { +pub fn acosh(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(acosh32, x), @@ -56,8 +53,8 @@ fn acosh64(x: f64) -> f64 { } test "math.acosh" { - assert(acosh_workaround(f32(1.5)) == acosh32(1.5)); - assert(acosh_workaround(f64(1.5)) == acosh64(1.5)); + assert(acosh(f32(1.5)) == acosh32(1.5)); + assert(acosh(f64(1.5)) == acosh64(1.5)); } test "math.acosh32" { diff --git a/std/math/asin.zig b/std/math/asin.zig index 3f705a9cf70816e84e927e82a5a1ad42eb93b6da..b0368b5d6680eb94befe93a1a1981ea1799066e2 100644 --- a/std/math/asin.zig +++ b/std/math/asin.zig @@ -6,10 +6,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -pub const asin = asin_workaround; - -// TODO issue #393 -pub fn asin_workaround(x: var) -> @typeOf(x) { +pub fn asin(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(asin32, x), @@ -138,8 +135,8 @@ fn asin64(x: f64) -> f64 { } test "math.asin" { - assert(asin_workaround(f32(0.0)) == asin32(0.0)); - assert(asin_workaround(f64(0.0)) == asin64(0.0)); + assert(asin(f32(0.0)) == asin32(0.0)); + assert(asin(f64(0.0)) == asin64(0.0)); } test "math.asin32" { diff --git a/std/math/asinh.zig b/std/math/asinh.zig index 27394e9ce4d072d3fa790d1f512fda9c939ff373..dab047036a065e7e956ce4941c83a0f28d85cad5 100644 --- a/std/math/asinh.zig +++ b/std/math/asinh.zig @@ -7,10 +7,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -pub const asinh = asinh_workaround; - -// TODO issue #393 -pub fn asinh_workaround(x: var) -> @typeOf(x) { +pub fn asinh(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(asinh32, x), @@ -84,8 +81,8 @@ fn asinh64(x: f64) -> f64 { } test "math.asinh" { - assert(asinh_workaround(f32(0.0)) == asinh32(0.0)); - assert(asinh_workaround(f64(0.0)) == asinh64(0.0)); + assert(asinh(f32(0.0)) == asinh32(0.0)); + assert(asinh(f64(0.0)) == asinh64(0.0)); } test "math.asinh32" { diff --git a/std/math/atan.zig b/std/math/atan.zig index 0c17617245c92bb8ebb60022234fad417f78eee4..5f3e20796071b1aa507707aadbd59ddfa52b60eb 100644 --- a/std/math/atan.zig +++ b/std/math/atan.zig @@ -6,10 +6,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const atan = atan_workaround; - -pub fn atan_workaround(x: var) -> @typeOf(x) { +pub fn atan(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(atan32, x), @@ -210,8 +207,8 @@ fn atan64(x_: f64) -> f64 { } test "math.atan" { - assert(atan_workaround(f32(0.2)) == atan32(0.2)); - assert(atan_workaround(f64(0.2)) == atan64(0.2)); + assert(atan(f32(0.2)) == atan32(0.2)); + assert(atan(f64(0.2)) == atan64(0.2)); } test "math.atan32" { diff --git a/std/math/atan2.zig b/std/math/atan2.zig index cbe8f5742d2e4f11a52e14ae6f1005b061c097a2..e61d217b49235abd946bb30c815698fab8a5ea74 100644 --- a/std/math/atan2.zig +++ b/std/math/atan2.zig @@ -21,10 +21,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -pub const atan2 = atan2_workaround; - -// TODO issue #393 -fn atan2_workaround(comptime T: type, x: T, y: T) -> T { +fn atan2(comptime T: type, x: T, y: T) -> T { switch (T) { f32 => @inlineCall(atan2_32, x, y), f64 => @inlineCall(atan2_64, x, y), @@ -208,8 +205,8 @@ fn atan2_64(y: f64, x: f64) -> f64 { } test "math.atan2" { - assert(atan2_workaround(f32, 0.2, 0.21) == atan2_32(0.2, 0.21)); - assert(atan2_workaround(f64, 0.2, 0.21) == atan2_64(0.2, 0.21)); + assert(atan2(f32, 0.2, 0.21) == atan2_32(0.2, 0.21)); + assert(atan2(f64, 0.2, 0.21) == atan2_64(0.2, 0.21)); } test "math.atan2_32" { diff --git a/std/math/atanh.zig b/std/math/atanh.zig index 7b1f3d09891c606dfeea500abb6f47a83d03678b..8fe5ab55a797193746ab3579a3dc98235cf1baaf 100644 --- a/std/math/atanh.zig +++ b/std/math/atanh.zig @@ -7,10 +7,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const atanh = atanh_workaround; - -pub fn atanh_workaround(x: var) -> @typeOf(x) { +pub fn atanh(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(atanh_32, x), diff --git a/std/math/cbrt.zig b/std/math/cbrt.zig index 3674f10c345165c0e1419c120bf30cb5aed50467..273939c6b641c526d623c38455d64cd10a6b38bf 100644 --- a/std/math/cbrt.zig +++ b/std/math/cbrt.zig @@ -7,10 +7,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const cbrt = cbrt_workaround; - -pub fn cbrt_workaround(x: var) -> @typeOf(x) { +pub fn cbrt(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(cbrt32, x), diff --git a/std/math/ceil.zig b/std/math/ceil.zig index d88031243b94c28071649e2e713e7cf931914731..2c7b28cc931225b8eda60cafa5b32307b7fc99e5 100644 --- a/std/math/ceil.zig +++ b/std/math/ceil.zig @@ -8,10 +8,7 @@ const builtin = @import("builtin"); const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const ceil = ceil_workaround; - -pub fn ceil_workaround(x: var) -> @typeOf(x) { +pub fn ceil(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(ceil32, x), diff --git a/std/math/copysign.zig b/std/math/copysign.zig index 8c2edeb2895d508313f3a34191c34c21f31b44ca..109ee8c63238401124bb631783146e506d29b868 100644 --- a/std/math/copysign.zig +++ b/std/math/copysign.zig @@ -1,10 +1,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const copysign = copysign_workaround; - -pub fn copysign_workaround(comptime T: type, x: T, y: T) -> T { +pub fn copysign(comptime T: type, x: T, y: T) -> T { switch (T) { f32 => @inlineCall(copysign32, x, y), f64 => @inlineCall(copysign64, x, y), diff --git a/std/math/cos.zig b/std/math/cos.zig index 8bd2a275f723d2ceed35c4a1644c33951d978f24..819336d270d14927eed33e2d83cea8a06eca9dfc 100644 --- a/std/math/cos.zig +++ b/std/math/cos.zig @@ -6,10 +6,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const cos = cos_workaround; - -pub fn cos_workaround(x: var) -> @typeOf(x) { +pub fn cos(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(cos32, x), diff --git a/std/math/cosh.zig b/std/math/cosh.zig index e59348531588fd9ab36263eb4f29d6f8f0583328..92902090f1ecfc68bde5fa43a61b043d2f20c71f 100644 --- a/std/math/cosh.zig +++ b/std/math/cosh.zig @@ -8,10 +8,7 @@ const math = @import("index.zig"); const expo2 = @import("expo2.zig").expo2; const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const cosh = cosh_workaround; - -pub fn cosh_workaround(x: var) -> @typeOf(x) { +pub fn cosh(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(cosh32, x), diff --git a/std/math/exp.zig b/std/math/exp.zig index 36c142c87269b5a02b5c71e4eb31778e52529968..87c0a1882e6045f6cb4b5528d225a5afe582a835 100644 --- a/std/math/exp.zig +++ b/std/math/exp.zig @@ -6,10 +6,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const exp = exp_workaround; - -pub fn exp_workaround(x: var) -> @typeOf(x) { +pub fn exp(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(exp32, x), diff --git a/std/math/exp2.zig b/std/math/exp2.zig index d04f72cbba6203f68ca45b2a547e56db8ad403b4..111c1dad6473a7811faf1a30b56fd19cce2f4df5 100644 --- a/std/math/exp2.zig +++ b/std/math/exp2.zig @@ -6,10 +6,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const exp2 = exp2_workaround; - -pub fn exp2_workaround(x: var) -> @typeOf(x) { +pub fn exp2(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(exp2_32, x), diff --git a/std/math/expm1.zig b/std/math/expm1.zig index 105d64417aba8d836603d9ab4a45946df3d0be26..5ee28e786666d425e63621f0cf301fa23212166c 100644 --- a/std/math/expm1.zig +++ b/std/math/expm1.zig @@ -7,10 +7,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const expm1 = expm1_workaround; - -pub fn expm1_workaround(x: var) -> @typeOf(x) { +pub fn expm1(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(expm1_32, x), diff --git a/std/math/fabs.zig b/std/math/fabs.zig index 185f1346638d9d1169f3e70d025b93f3966e37bd..e9bd3eb6899dd2a18aba9e8edf221ece318ad559 100644 --- a/std/math/fabs.zig +++ b/std/math/fabs.zig @@ -6,10 +6,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const fabs = fabs_workaround; - -pub fn fabs_workaround(x: var) -> @typeOf(x) { +pub fn fabs(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(fabs32, x), diff --git a/std/math/floor.zig b/std/math/floor.zig index e14e560ef743fd5ddc06e64f159917f36370b3da..85ee2b4923862a1f4f25512b0de3abf735d7bbf6 100644 --- a/std/math/floor.zig +++ b/std/math/floor.zig @@ -8,10 +8,7 @@ const builtin = @import("builtin"); const assert = @import("../debug.zig").assert; const math = @import("index.zig"); -// TODO issue #393 -pub const floor = floor_workaround; - -pub fn floor_workaround(x: var) -> @typeOf(x) { +pub fn floor(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(floor32, x), diff --git a/std/math/fma.zig b/std/math/fma.zig index 4545fc20f2c9cbedd92ad7cc25919f40dc72bdeb..8dbbc39ed0eac9d9b353b7d6ce2faaa3aed7ff7b 100644 --- a/std/math/fma.zig +++ b/std/math/fma.zig @@ -1,10 +1,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const fma = fma_workaround; - -pub fn fma_workaround(comptime T: type, x: T, y: T, z: T) -> T { +pub fn fma(comptime T: type, x: T, y: T, z: T) -> T { switch (T) { f32 => @inlineCall(fma32, x, y, z), f64 => @inlineCall(fma64, x, y ,z), diff --git a/std/math/frexp.zig b/std/math/frexp.zig index 87e35335fe30f9f6e1ef21627745c3ad277b3b88..a40a6dcc396e145f9d457f4229323fd837be06b4 100644 --- a/std/math/frexp.zig +++ b/std/math/frexp.zig @@ -7,9 +7,6 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const frexp = frexp_workaround; - fn frexp_result(comptime T: type) -> type { struct { significand: T, @@ -19,7 +16,7 @@ fn frexp_result(comptime T: type) -> type { pub const frexp32_result = frexp_result(f32); pub const frexp64_result = frexp_result(f64); -pub fn frexp_workaround(x: var) -> frexp_result(@typeOf(x)) { +pub fn frexp(x: var) -> frexp_result(@typeOf(x)) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(frexp32, x), diff --git a/std/math/hypot.zig b/std/math/hypot.zig index f864237ba367b1484d5feafcf8a4e23499766195..ee8ce0f518f292200284217d1f37cdb4ea6630df 100644 --- a/std/math/hypot.zig +++ b/std/math/hypot.zig @@ -8,10 +8,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const hypot = hypot_workaround; - -pub fn hypot_workaround(comptime T: type, x: T, y: T) -> T { +pub fn hypot(comptime T: type, x: T, y: T) -> T { switch (T) { f32 => @inlineCall(hypot32, x, y), f64 => @inlineCall(hypot64, x, y), diff --git a/std/math/ilogb.zig b/std/math/ilogb.zig index 5bdbe5f2545f2b95db4cdb447c6adc691d80bfb7..2a0ea7fc5f1740db37750fb2be205d18986b5718 100644 --- a/std/math/ilogb.zig +++ b/std/math/ilogb.zig @@ -7,10 +7,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const ilogb = ilogb_workaround; - -pub fn ilogb_workaround(x: var) -> i32 { +pub fn ilogb(x: var) -> i32 { const T = @typeOf(x); switch (T) { f32 => @inlineCall(ilogb32, x), diff --git a/std/math/ln.zig b/std/math/ln.zig index a0a1429cfa1c697d066a3b444c9445748c500902..b77c6cef5b757afb437181cff122f705a90fd23e 100644 --- a/std/math/ln.zig +++ b/std/math/ln.zig @@ -10,9 +10,7 @@ const assert = @import("../debug.zig").assert; const builtin = @import("builtin"); const TypeId = builtin.TypeId; -pub const ln = ln_workaround; - -fn ln_workaround(x: var) -> @typeOf(x) { +pub fn ln(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (@typeId(T)) { TypeId.FloatLiteral => { diff --git a/std/math/log.zig b/std/math/log.zig index 180c3aeb31951c4982167e0a459aeb1a1bcbf21c..556113578f9548a55f1bc73c24b0028f8d01d333 100644 --- a/std/math/log.zig +++ b/std/math/log.zig @@ -3,10 +3,7 @@ const builtin = @import("builtin"); const TypeId = builtin.TypeId; const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const log = log_workaround; - -fn log_workaround(comptime T: type, base: T, x: T) -> T { +pub fn log(comptime T: type, base: T, x: T) -> T { if (base == 2) { return math.log2(x); } else if (base == 10) { diff --git a/std/math/log10.zig b/std/math/log10.zig index a0456e593d61a6a451e587d701b7c0f1a5fb8f1c..d40475f28d7caa87da872f138c8a1f8dfb4faf05 100644 --- a/std/math/log10.zig +++ b/std/math/log10.zig @@ -10,10 +10,7 @@ const assert = @import("../debug.zig").assert; const builtin = @import("builtin"); const TypeId = builtin.TypeId; -// TODO issue #393 -pub const log10 = log10_workaround; - -fn log10_workaround(x: var) -> @typeOf(x) { +pub fn log10(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (@typeId(T)) { TypeId.FloatLiteral => { diff --git a/std/math/log1p.zig b/std/math/log1p.zig index a49b78d0aa0abbaa0794d8a22c14b832689c41e3..803726fdcc2f6c1e191fe5d300e8306869e5523a 100644 --- a/std/math/log1p.zig +++ b/std/math/log1p.zig @@ -9,10 +9,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const log1p = log1p_workaround; - -pub fn log1p_workaround(x: var) -> @typeOf(x) { +pub fn log1p(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(log1p_32, x), diff --git a/std/math/log2.zig b/std/math/log2.zig index 979726442ea741ee2fa7cac53f016acf3036cd2a..86d6487f09c383b805947dcf6dcf9f0e91b315bc 100644 --- a/std/math/log2.zig +++ b/std/math/log2.zig @@ -10,10 +10,7 @@ const assert = @import("../debug.zig").assert; const builtin = @import("builtin"); const TypeId = builtin.TypeId; -// TODO issue #393 -pub const log2 = log2_workaround; - -fn log2_workaround(x: var) -> @typeOf(x) { +pub fn log2(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (@typeId(T)) { TypeId.FloatLiteral => { diff --git a/std/math/modf.zig b/std/math/modf.zig index eb2419b134713e2be270ded91352b29173de7759..25eab7f99d3cbffff1f8f8368b2fa3420f552f25 100644 --- a/std/math/modf.zig +++ b/std/math/modf.zig @@ -6,9 +6,6 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const modf = modf_workaround; - fn modf_result(comptime T: type) -> type { struct { fpart: T, @@ -18,7 +15,7 @@ fn modf_result(comptime T: type) -> type { pub const modf32_result = modf_result(f32); pub const modf64_result = modf_result(f64); -pub fn modf_workaround(x: var) -> modf_result(@typeOf(x)) { +pub fn modf(x: var) -> modf_result(@typeOf(x)) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(modf32, x), diff --git a/std/math/nan.zig b/std/math/nan.zig index 3c7b33e8c4fb689c863af8ef8e06020a8a3f5c18..a4899d6b82305e7a7b15ad4816ac5b840af20bc0 100644 --- a/std/math/nan.zig +++ b/std/math/nan.zig @@ -1,8 +1,6 @@ const math = @import("index.zig"); -pub const nan = nan_workaround; - -pub fn nan_workaround(comptime T: type) -> T { +pub fn nan(comptime T: type) -> T { switch (T) { f32 => @bitCast(f32, math.nan_u32), f64 => @bitCast(f64, math.nan_u64), @@ -10,11 +8,9 @@ pub fn nan_workaround(comptime T: type) -> T { } } -pub const snan = snan_workaround; - // Note: A signalling nan is identical to a standard right now by may have a different bit // representation in the future when required. -pub fn snan_workaround(comptime T: type) -> T { +pub fn snan(comptime T: type) -> T { switch (T) { f32 => @bitCast(f32, math.nan_u32), f64 => @bitCast(f64, math.nan_u64), diff --git a/std/math/pow.zig b/std/math/pow.zig index 042e0c3d1ed2df4a69dfdc2aaf32d1741515fcff..4dae71594b872159f3cc692b5cdf3a17068a15fb 100644 --- a/std/math/pow.zig +++ b/std/math/pow.zig @@ -24,11 +24,8 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const pow = pow_workaround; - // This implementation is taken from the go stlib, musl is a bit more complex. -pub fn pow_workaround(comptime T: type, x: T, y: T) -> T { +pub fn pow(comptime T: type, x: T, y: T) -> T { @setFloatMode(this, @import("builtin").FloatMode.Strict); diff --git a/std/math/round.zig b/std/math/round.zig index 6b7cbf1172a6783fc09dad3d5b98196e1044e788..d281651dcd0fd15bba1822da264b3d096886d54d 100644 --- a/std/math/round.zig +++ b/std/math/round.zig @@ -8,10 +8,7 @@ const builtin = @import("builtin"); const assert = @import("../debug.zig").assert; const math = @import("index.zig"); -// TODO issue #393 -pub const round = round_workaround; - -pub fn round_workaround(x: var) -> @typeOf(x) { +pub fn round(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(round32, x), diff --git a/std/math/scalbn.zig b/std/math/scalbn.zig index fcd1a5e68c10485c672f490269088e7621d1028b..bb1e208b9e9932dc9a4e980943dd971c7c27cdd3 100644 --- a/std/math/scalbn.zig +++ b/std/math/scalbn.zig @@ -1,10 +1,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const scalbn = scalbn_workaround; - -pub fn scalbn_workaround(x: var, n: i32) -> @typeOf(x) { +pub fn scalbn(x: var, n: i32) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(scalbn32, x, n), diff --git a/std/math/signbit.zig b/std/math/signbit.zig index 979c45bf41221b5a775bf8fe79be0a513043c0ee..75b087f53993fac49e5dafb50e20e29f2ce9087b 100644 --- a/std/math/signbit.zig +++ b/std/math/signbit.zig @@ -1,10 +1,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const signbit = signbit_workaround; - -pub fn signbit_workaround(x: var) -> bool { +pub fn signbit(x: var) -> bool { const T = @typeOf(x); switch (T) { f32 => @inlineCall(signbit32, x), diff --git a/std/math/sin.zig b/std/math/sin.zig index 4fe7565cd362f84de75ac8127ae3537f1da2b290..5513ec324ed3f38244fea50e7fd713efd5bca7cf 100644 --- a/std/math/sin.zig +++ b/std/math/sin.zig @@ -7,10 +7,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const sin = sin_workaround; - -pub fn sin_workaround(x: var) -> @typeOf(x) { +pub fn sin(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(sin32, x), diff --git a/std/math/sinh.zig b/std/math/sinh.zig index e1b001d287508cad049de50c61a301681e6c6b6f..82318196d8554eb07df7ff7aa293046b1ca25c6e 100644 --- a/std/math/sinh.zig +++ b/std/math/sinh.zig @@ -8,10 +8,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; const expo2 = @import("expo2.zig").expo2; -// TODO issue #393 -pub const sinh = sinh_workaround; - -pub fn sinh_workaround(x: var) -> @typeOf(x) { +pub fn sinh(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(sinh32, x), diff --git a/std/math/sqrt.zig b/std/math/sqrt.zig index 4cb65bfac279189b52d6b602d4fbd4e69349924b..bd1bb1fca449e37c4f5d846582baa8be930f9798 100644 --- a/std/math/sqrt.zig +++ b/std/math/sqrt.zig @@ -8,10 +8,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -// TODO issue #393 -pub const sqrt = sqrt_workaround; - -pub fn sqrt_workaround(x: var) -> @typeOf(x) { +pub fn sqrt(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(sqrt32, x), diff --git a/std/math/tan.zig b/std/math/tan.zig index 4ef4bf6c7363bf8562bac7aff469b0f5ecb1c48a..fcb62f5046d034e4ab757d77a8ab237a9f2f2f96 100644 --- a/std/math/tan.zig +++ b/std/math/tan.zig @@ -7,9 +7,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -pub const tan = tan_workaround; - -pub fn tan_workaround(x: var) -> @typeOf(x) { +pub fn tan(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(tan32, x), diff --git a/std/math/tanh.zig b/std/math/tanh.zig index c88dc081561be3e31e5e978c6b340f4f6a133fa5..866a678318c1f4f919027e156acfaab8bf9fe632 100644 --- a/std/math/tanh.zig +++ b/std/math/tanh.zig @@ -8,10 +8,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; const expo2 = @import("expo2.zig").expo2; -// TODO issue #393 -pub const tanh = tanh_workaround; - -pub fn tanh_workaround(x: var) -> @typeOf(x) { +pub fn tanh(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(tanh32, x), diff --git a/std/math/trunc.zig b/std/math/trunc.zig index 69e8f3757724637a9227aad4dc9037a8bd872390..937a8155e63db09def63522a7c1296b8c39ce437 100644 --- a/std/math/trunc.zig +++ b/std/math/trunc.zig @@ -7,9 +7,7 @@ const math = @import("index.zig"); const assert = @import("../debug.zig").assert; -pub const trunc = trunc_workaround; - -pub fn trunc_workaround(x: var) -> @typeOf(x) { +pub fn trunc(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(trunc32, x), -- 2.54.0