From 0f7dfb984a115625cb29f42351a2503c4c887a75 Mon Sep 17 00:00:00 2001 From: Ulises Jeremias Cornejo Fandos Date: Sun, 10 Oct 2021 05:21:48 -0300 Subject: [PATCH] math: remove the C backend for f64 functions (#12121) --- vlib/math/abs.c.v | 8 -------- vlib/math/cbrt.c.v | 9 --------- vlib/math/div.c.v | 9 --------- vlib/math/erf.c.v | 17 ----------------- vlib/math/exp.c.v | 17 ----------------- vlib/math/floor.c.v | 34 ---------------------------------- vlib/math/gamma.c.v | 17 ----------------- vlib/math/hypot.c.v | 9 --------- vlib/math/log.c.v | 25 ------------------------- vlib/math/sinh.c.v | 17 ----------------- vlib/math/sqrt.c.v | 8 -------- vlib/math/tan.c.v | 8 -------- vlib/math/tanh.c.v | 9 --------- 13 files changed, 187 deletions(-) delete mode 100644 vlib/math/abs.c.v delete mode 100644 vlib/math/cbrt.c.v delete mode 100644 vlib/math/div.c.v delete mode 100644 vlib/math/erf.c.v delete mode 100644 vlib/math/exp.c.v delete mode 100644 vlib/math/floor.c.v delete mode 100644 vlib/math/gamma.c.v delete mode 100644 vlib/math/hypot.c.v delete mode 100644 vlib/math/log.c.v delete mode 100644 vlib/math/sinh.c.v delete mode 100644 vlib/math/tanh.c.v diff --git a/vlib/math/abs.c.v b/vlib/math/abs.c.v deleted file mode 100644 index 983ddcbb9..000000000 --- a/vlib/math/abs.c.v +++ /dev/null @@ -1,8 +0,0 @@ -module math - -fn C.fabs(x f64) f64 - -[inline] -pub fn abs(a f64) f64 { - return C.fabs(a) -} diff --git a/vlib/math/cbrt.c.v b/vlib/math/cbrt.c.v deleted file mode 100644 index 892075a5e..000000000 --- a/vlib/math/cbrt.c.v +++ /dev/null @@ -1,9 +0,0 @@ -module math - -fn C.cbrt(x f64) f64 - -// cbrt calculates cubic root. -[inline] -pub fn cbrt(a f64) f64 { - return C.cbrt(a) -} diff --git a/vlib/math/div.c.v b/vlib/math/div.c.v deleted file mode 100644 index 90cee1af9..000000000 --- a/vlib/math/div.c.v +++ /dev/null @@ -1,9 +0,0 @@ -module math - -fn C.fmod(x f64, y f64) f64 - -// fmod returns the floating-point remainder of number / denom (rounded towards zero): -[inline] -pub fn fmod(x f64, y f64) f64 { - return C.fmod(x, y) -} diff --git a/vlib/math/erf.c.v b/vlib/math/erf.c.v deleted file mode 100644 index 160615210..000000000 --- a/vlib/math/erf.c.v +++ /dev/null @@ -1,17 +0,0 @@ -module math - -fn C.erf(x f64) f64 - -fn C.erfc(x f64) f64 - -// erf computes the error function value -[inline] -pub fn erf(a f64) f64 { - return C.erf(a) -} - -// erfc computes the complementary error function value -[inline] -pub fn erfc(a f64) f64 { - return C.erfc(a) -} diff --git a/vlib/math/exp.c.v b/vlib/math/exp.c.v deleted file mode 100644 index 7818438a8..000000000 --- a/vlib/math/exp.c.v +++ /dev/null @@ -1,17 +0,0 @@ -module math - -fn C.exp(x f64) f64 - -fn C.exp2(x f64) f64 - -// exp calculates exponent of the number (math.pow(math.E, x)). -[inline] -pub fn exp(x f64) f64 { - return C.exp(x) -} - -// exp2 returns the base-2 exponential function of a (math.pow(2, x)). -[inline] -pub fn exp2(x f64) f64 { - return C.exp2(x) -} diff --git a/vlib/math/floor.c.v b/vlib/math/floor.c.v deleted file mode 100644 index 1dc933069..000000000 --- a/vlib/math/floor.c.v +++ /dev/null @@ -1,34 +0,0 @@ -module math - -fn C.ceil(x f64) f64 - -fn C.floor(x f64) f64 - -fn C.round(x f64) f64 - -fn C.trunc(x f64) f64 - -// ceil returns the nearest f64 greater or equal to the provided value. -[inline] -pub fn ceil(x f64) f64 { - return C.ceil(x) -} - -// floor returns the nearest f64 lower or equal of the provided value. -[inline] -pub fn floor(x f64) f64 { - return C.floor(x) -} - -// round returns the integer nearest to the provided value. -[inline] -pub fn round(x f64) f64 { - return C.round(x) -} - -// trunc rounds a toward zero, returning the nearest integral value that is not -// larger in magnitude than a. -[inline] -pub fn trunc(x f64) f64 { - return C.trunc(x) -} diff --git a/vlib/math/gamma.c.v b/vlib/math/gamma.c.v deleted file mode 100644 index a4451cefa..000000000 --- a/vlib/math/gamma.c.v +++ /dev/null @@ -1,17 +0,0 @@ -module math - -fn C.tgamma(x f64) f64 - -fn C.lgamma(x f64) f64 - -// gamma computes the gamma function value -[inline] -pub fn gamma(a f64) f64 { - return C.tgamma(a) -} - -// log_gamma computes the log-gamma function value -[inline] -pub fn log_gamma(x f64) f64 { - return C.lgamma(x) -} diff --git a/vlib/math/hypot.c.v b/vlib/math/hypot.c.v deleted file mode 100644 index 9710ea4a1..000000000 --- a/vlib/math/hypot.c.v +++ /dev/null @@ -1,9 +0,0 @@ -module math - -fn C.hypot(x f64, y f64) f64 - -// Returns hypotenuse of a right triangle. -[inline] -pub fn hypot(x f64, y f64) f64 { - return C.hypot(x, y) -} diff --git a/vlib/math/log.c.v b/vlib/math/log.c.v deleted file mode 100644 index f2f8c9397..000000000 --- a/vlib/math/log.c.v +++ /dev/null @@ -1,25 +0,0 @@ -module math - -fn C.log(x f64) f64 - -fn C.log2(x f64) f64 - -fn C.log10(x f64) f64 - -// log calculates natural (base-e) logarithm of the provided value. -[inline] -pub fn log(x f64) f64 { - return C.log(x) -} - -// log2 calculates base-2 logarithm of the provided value. -[inline] -pub fn log2(x f64) f64 { - return C.log2(x) -} - -// log10 calculates the common (base-10) logarithm of the provided value. -[inline] -pub fn log10(x f64) f64 { - return C.log10(x) -} diff --git a/vlib/math/sinh.c.v b/vlib/math/sinh.c.v deleted file mode 100644 index b25eef0ba..000000000 --- a/vlib/math/sinh.c.v +++ /dev/null @@ -1,17 +0,0 @@ -module math - -fn C.cosh(x f64) f64 - -fn C.sinh(x f64) f64 - -// cosh calculates hyperbolic cosine. -[inline] -pub fn cosh(a f64) f64 { - return C.cosh(a) -} - -// sinh calculates hyperbolic sine. -[inline] -pub fn sinh(a f64) f64 { - return C.sinh(a) -} diff --git a/vlib/math/sqrt.c.v b/vlib/math/sqrt.c.v index a070c32f7..02766657f 100644 --- a/vlib/math/sqrt.c.v +++ b/vlib/math/sqrt.c.v @@ -1,15 +1,7 @@ module math -fn C.sqrt(x f64) f64 - fn C.sqrtf(x f32) f32 -// sqrt calculates square-root of the provided value. -[inline] -pub fn sqrt(a f64) f64 { - return C.sqrt(a) -} - // sqrtf calculates square-root of the provided value. (float32) [inline] pub fn sqrtf(a f32) f32 { diff --git a/vlib/math/tan.c.v b/vlib/math/tan.c.v index af8e1ca8c..056d37d51 100644 --- a/vlib/math/tan.c.v +++ b/vlib/math/tan.c.v @@ -1,15 +1,7 @@ module math -fn C.tan(x f64) f64 - fn C.tanf(x f32) f32 -// tan calculates tangent. -[inline] -pub fn tan(a f64) f64 { - return C.tan(a) -} - // tanf calculates tangent. (float32) [inline] pub fn tanf(a f32) f32 { diff --git a/vlib/math/tanh.c.v b/vlib/math/tanh.c.v deleted file mode 100644 index 05568c2f9..000000000 --- a/vlib/math/tanh.c.v +++ /dev/null @@ -1,9 +0,0 @@ -module math - -fn C.tanh(x f64) f64 - -// tanh calculates hyperbolic tangent. -[inline] -pub fn tanh(a f64) f64 { - return C.tanh(a) -} -- 2.30.2