math: remove the C backend for f64 functions (#12121)
parent
83bc9b35b1
commit
0f7dfb984a
|
@ -1,8 +0,0 @@
|
|||
module math
|
||||
|
||||
fn C.fabs(x f64) f64
|
||||
|
||||
[inline]
|
||||
pub fn abs(a f64) f64 {
|
||||
return C.fabs(a)
|
||||
}
|
|
@ -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)
|
||||
}
|
|
@ -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)
|
||||
}
|
|
@ -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)
|
||||
}
|
|
@ -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)
|
||||
}
|
|
@ -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)
|
||||
}
|
|
@ -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)
|
||||
}
|
|
@ -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)
|
||||
}
|
|
@ -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)
|
||||
}
|
|
@ -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)
|
||||
}
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
Loading…
Reference in New Issue