1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

math: remove the C backend for f64 functions (#12121)

This commit is contained in:
Ulises Jeremias Cornejo Fandos 2021-10-10 05:21:48 -03:00 committed by GitHub
parent 83bc9b35b1
commit 0f7dfb984a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 0 additions and 187 deletions

View File

@ -1,8 +0,0 @@
module math
fn C.fabs(x f64) f64
[inline]
pub fn abs(a f64) f64 {
return C.fabs(a)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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 {

View File

@ -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 {

View File

@ -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)
}