about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-01 13:26:49 -0700
committerbors <bors@rust-lang.org>2014-04-01 13:26:49 -0700
commit1217cfb9e7e449c9ef5ee0844e7d3be324648f02 (patch)
treece831ee4530348b32b5ccbb6c0dfa1d15df3279e /src/libstd
parentb71c02e512fcfe18ea7a5a8a99ac758b4fa564a6 (diff)
parent5e12e1b1a49134f578e1778f4a1216221417bc5e (diff)
downloadrust-1217cfb9e7e449c9ef5ee0844e7d3be324648f02.tar.gz
rust-1217cfb9e7e449c9ef5ee0844e7d3be324648f02.zip
auto merge of #13225 : thestinger/rust/num, r=cmr
The `Float` trait methods will be usable as functions via UFCS, and
we came to a consensus to remove duplicate functions like this a long
time ago.

It does still make sense to keep the duplicate functions when the trait
methods are static, unless the decision to leave out the in-scope trait
name resolution for static methods changes.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/lib.rs2
-rw-r--r--src/libstd/num/cmath.rs151
-rw-r--r--src/libstd/num/f32.rs84
-rw-r--r--src/libstd/num/f64.rs94
-rw-r--r--src/libstd/num/mod.rs73
5 files changed, 126 insertions, 278 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index ab75031e914..fb6c1b4c8a3 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -206,8 +206,6 @@ pub mod raw;
 /* For internal use, not exported */
 
 mod unicode;
-#[path = "num/cmath.rs"]
-mod cmath;
 
 // FIXME #7809: This shouldn't be pub, and it should be reexported under 'unstable'
 // but name resolution doesn't work without it being pub.
diff --git a/src/libstd/num/cmath.rs b/src/libstd/num/cmath.rs
deleted file mode 100644
index 32864f14c96..00000000000
--- a/src/libstd/num/cmath.rs
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![allow(missing_doc)]
-#![allow(dead_code)]
-
-//! Bindings for the C math library (for basic mathematic functions)
-
-// Function names are almost identical to C's libmath, a few have been
-// renamed, grep for "rename:"
-
-pub mod c_double {
-    use libc::{c_double, c_int};
-
-    #[link_name = "m"]
-    extern {
-        // Alphabetically sorted by link_name
-
-        pub fn acos(n: c_double) -> c_double;
-        pub fn asin(n: c_double) -> c_double;
-        pub fn atan(n: c_double) -> c_double;
-        pub fn atan2(a: c_double, b: c_double) -> c_double;
-        pub fn cbrt(n: c_double) -> c_double;
-        pub fn cosh(n: c_double) -> c_double;
-        pub fn erf(n: c_double) -> c_double;
-        pub fn erfc(n: c_double) -> c_double;
-        // rename: for consistency with underscore usage elsewhere
-        #[link_name="expm1"]
-        pub fn exp_m1(n: c_double) -> c_double;
-        // rename: for clarity and consistency with add/sub/mul/div
-        #[link_name="fdim"]
-        pub fn abs_sub(a: c_double, b: c_double) -> c_double;
-        #[link_name="fmax"]
-        pub fn fmax(a: c_double, b: c_double) -> c_double;
-        #[link_name="fmin"]
-        pub fn fmin(a: c_double, b: c_double) -> c_double;
-        #[link_name="nextafter"]
-        pub fn next_after(x: c_double, y: c_double) -> c_double;
-        pub fn frexp(n: c_double, value: &mut c_int) -> c_double;
-        pub fn hypot(x: c_double, y: c_double) -> c_double;
-        pub fn ldexp(x: c_double, n: c_int) -> c_double;
-        #[cfg(unix)]
-        #[link_name="lgamma_r"]
-        pub fn lgamma(n: c_double, sign: &mut c_int) -> c_double;
-        #[cfg(windows)]
-        #[link_name="__lgamma_r"]
-        pub fn lgamma(n: c_double, sign: &mut c_int) -> c_double;
-        // renamed: "logb" /often/ is confused for log2 by beginners
-        #[link_name="logb"]
-        pub fn log_radix(n: c_double) -> c_double;
-        // renamed: to be consitent with log as ln
-        #[link_name="log1p"]
-        pub fn ln_1p(n: c_double) -> c_double;
-        #[link_name="ilogb"]
-        pub fn ilog_radix(n: c_double) -> c_int;
-        pub fn modf(n: c_double, iptr: &mut c_double) -> c_double;
-        // rename: for consistency with logradix
-        #[link_name="scalbn"]
-        pub fn ldexp_radix(n: c_double, i: c_int) -> c_double;
-        pub fn sinh(n: c_double) -> c_double;
-        pub fn tan(n: c_double) -> c_double;
-        pub fn tanh(n: c_double) -> c_double;
-        pub fn tgamma(n: c_double) -> c_double;
-
-        // These are commonly only available for doubles
-
-        pub fn j0(n: c_double) -> c_double;
-        pub fn j1(n: c_double) -> c_double;
-        pub fn jn(i: c_int, n: c_double) -> c_double;
-
-        pub fn y0(n: c_double) -> c_double;
-        pub fn y1(n: c_double) -> c_double;
-        pub fn yn(i: c_int, n: c_double) -> c_double;
-    }
-}
-
-pub mod c_float {
-    use libc::{c_float, c_int};
-
-    #[link_name = "m"]
-    extern {
-        // Alphabetically sorted by link_name
-
-        #[link_name="acosf"]
-        pub fn acos(n: c_float) -> c_float;
-        #[link_name="asinf"]
-        pub fn asin(n: c_float) -> c_float;
-        #[link_name="atanf"]
-        pub fn atan(n: c_float) -> c_float;
-        #[link_name="atan2f"]
-        pub fn atan2(a: c_float, b: c_float) -> c_float;
-        #[link_name="cbrtf"]
-        pub fn cbrt(n: c_float) -> c_float;
-        #[link_name="coshf"]
-        pub fn cosh(n: c_float) -> c_float;
-        #[link_name="erff"]
-        pub fn erf(n: c_float) -> c_float;
-        #[link_name="erfcf"]
-        pub fn erfc(n: c_float) -> c_float;
-        #[link_name="expm1f"]
-        pub fn exp_m1(n: c_float) -> c_float;
-        #[link_name="fdimf"]
-        pub fn abs_sub(a: c_float, b: c_float) -> c_float;
-        #[link_name="frexpf"]
-        pub fn frexp(n: c_float, value: &mut c_int) -> c_float;
-        #[link_name="fmaxf"]
-        pub fn fmax(a: c_float, b: c_float) -> c_float;
-        #[link_name="fminf"]
-        pub fn fmin(a: c_float, b: c_float) -> c_float;
-        #[link_name="nextafterf"]
-        pub fn next_after(x: c_float, y: c_float) -> c_float;
-        #[link_name="hypotf"]
-        pub fn hypot(x: c_float, y: c_float) -> c_float;
-        #[link_name="ldexpf"]
-        pub fn ldexp(x: c_float, n: c_int) -> c_float;
-
-        #[cfg(unix)]
-        #[link_name="lgammaf_r"]
-        pub fn lgamma(n: c_float, sign: &mut c_int) -> c_float;
-
-        #[cfg(windows)]
-        #[link_name="__lgammaf_r"]
-        pub fn lgamma(n: c_float, sign: &mut c_int) -> c_float;
-
-        #[link_name="logbf"]
-        pub fn log_radix(n: c_float) -> c_float;
-        #[link_name="log1pf"]
-        pub fn ln_1p(n: c_float) -> c_float;
-        #[link_name="ilogbf"]
-        pub fn ilog_radix(n: c_float) -> c_int;
-        #[link_name="modff"]
-        pub fn modf(n: c_float, iptr: &mut c_float) -> c_float;
-        #[link_name="scalbnf"]
-        pub fn ldexp_radix(n: c_float, i: c_int) -> c_float;
-        #[link_name="sinhf"]
-        pub fn sinh(n: c_float) -> c_float;
-        #[link_name="tanf"]
-        pub fn tan(n: c_float) -> c_float;
-        #[link_name="tanhf"]
-        pub fn tanh(n: c_float) -> c_float;
-        #[link_name="tgammaf"]
-        pub fn tgamma(n: c_float) -> c_float;
-    }
-}
diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs
index 99484f41de1..6bae0648a57 100644
--- a/src/libstd/num/f32.rs
+++ b/src/libstd/num/f32.rs
@@ -14,7 +14,6 @@
 
 use prelude::*;
 
-use cmath;
 use default::Default;
 use from_str::FromStr;
 use libc::{c_float, c_int};
@@ -23,6 +22,46 @@ use num::{Zero, One, Bounded, strconv};
 use num;
 use intrinsics;
 
+#[allow(dead_code)]
+mod cmath {
+    use libc::{c_float, c_int};
+
+    #[link_name = "m"]
+    extern {
+        pub fn acosf(n: c_float) -> c_float;
+        pub fn asinf(n: c_float) -> c_float;
+        pub fn atanf(n: c_float) -> c_float;
+        pub fn atan2f(a: c_float, b: c_float) -> c_float;
+        pub fn cbrtf(n: c_float) -> c_float;
+        pub fn coshf(n: c_float) -> c_float;
+        pub fn erff(n: c_float) -> c_float;
+        pub fn erfcf(n: c_float) -> c_float;
+        pub fn expm1f(n: c_float) -> c_float;
+        pub fn fdimf(a: c_float, b: c_float) -> c_float;
+        pub fn frexpf(n: c_float, value: &mut c_int) -> c_float;
+        pub fn fmaxf(a: c_float, b: c_float) -> c_float;
+        pub fn fminf(a: c_float, b: c_float) -> c_float;
+        pub fn nextafterf(x: c_float, y: c_float) -> c_float;
+        pub fn hypotf(x: c_float, y: c_float) -> c_float;
+        pub fn ldexpf(x: c_float, n: c_int) -> c_float;
+        pub fn logbf(n: c_float) -> c_float;
+        pub fn log1pf(n: c_float) -> c_float;
+        pub fn ilogbf(n: c_float) -> c_int;
+        pub fn modff(n: c_float, iptr: &mut c_float) -> c_float;
+        pub fn sinhf(n: c_float) -> c_float;
+        pub fn tanf(n: c_float) -> c_float;
+        pub fn tanhf(n: c_float) -> c_float;
+        pub fn tgammaf(n: c_float) -> c_float;
+
+        #[cfg(unix)]
+        pub fn lgammaf_r(n: c_float, sign: &mut c_int) -> c_float;
+
+        #[cfg(windows)]
+        #[link_name="__lgammaf_r"]
+        pub fn lgammaf_r(n: c_float, sign: &mut c_int) -> c_float;
+    }
+}
+
 macro_rules! delegate(
     (
         $(
@@ -66,29 +105,22 @@ delegate!(
     fn nearbyint(n: f32) -> f32 = intrinsics::nearbyintf32,
     fn round(n: f32) -> f32 = intrinsics::roundf32,
 
-    // cmath
-    fn acos(n: c_float) -> c_float = cmath::c_float::acos,
-    fn asin(n: c_float) -> c_float = cmath::c_float::asin,
-    fn atan(n: c_float) -> c_float = cmath::c_float::atan,
-    fn atan2(a: c_float, b: c_float) -> c_float = cmath::c_float::atan2,
-    fn cbrt(n: c_float) -> c_float = cmath::c_float::cbrt,
-    fn cosh(n: c_float) -> c_float = cmath::c_float::cosh,
-    // fn erf(n: c_float) -> c_float = cmath::c_float::erf,
-    // fn erfc(n: c_float) -> c_float = cmath::c_float::erfc,
-    fn exp_m1(n: c_float) -> c_float = cmath::c_float::exp_m1,
-    fn abs_sub(a: c_float, b: c_float) -> c_float = cmath::c_float::abs_sub,
-    fn next_after(x: c_float, y: c_float) -> c_float = cmath::c_float::next_after,
-    fn frexp(n: c_float, value: &mut c_int) -> c_float = cmath::c_float::frexp,
-    fn hypot(x: c_float, y: c_float) -> c_float = cmath::c_float::hypot,
-    fn ldexp(x: c_float, n: c_int) -> c_float = cmath::c_float::ldexp,
-    // fn log_radix(n: c_float) -> c_float = cmath::c_float::log_radix,
-    fn ln_1p(n: c_float) -> c_float = cmath::c_float::ln_1p,
-    // fn ilog_radix(n: c_float) -> c_int = cmath::c_float::ilog_radix,
-    // fn modf(n: c_float, iptr: &mut c_float) -> c_float = cmath::c_float::modf,
-    // fn ldexp_radix(n: c_float, i: c_int) -> c_float = cmath::c_float::ldexp_radix,
-    fn sinh(n: c_float) -> c_float = cmath::c_float::sinh,
-    fn tan(n: c_float) -> c_float = cmath::c_float::tan,
-    fn tanh(n: c_float) -> c_float = cmath::c_float::tanh
+    fn acos(n: c_float) -> c_float = cmath::acosf,
+    fn asin(n: c_float) -> c_float = cmath::asinf,
+    fn atan(n: c_float) -> c_float = cmath::atanf,
+    fn atan2(a: c_float, b: c_float) -> c_float = cmath::atan2f,
+    fn cbrt(n: c_float) -> c_float = cmath::cbrtf,
+    fn cosh(n: c_float) -> c_float = cmath::coshf,
+    fn exp_m1(n: c_float) -> c_float = cmath::expm1f,
+    fn abs_sub(a: c_float, b: c_float) -> c_float = cmath::fdimf,
+    fn next_after(x: c_float, y: c_float) -> c_float = cmath::nextafterf,
+    fn frexp(n: c_float, value: &mut c_int) -> c_float = cmath::frexpf,
+    fn hypot(x: c_float, y: c_float) -> c_float = cmath::hypotf,
+    fn ldexp(x: c_float, n: c_int) -> c_float = cmath::ldexpf,
+    fn ln_1p(n: c_float) -> c_float = cmath::log1pf,
+    fn sinh(n: c_float) -> c_float = cmath::sinhf,
+    fn tan(n: c_float) -> c_float = cmath::tanf,
+    fn tanh(n: c_float) -> c_float = cmath::tanhf
 )
 
 // FIXME(#11621): These constants should be deprecated once CTFE is implemented
@@ -308,12 +340,12 @@ impl Primitive for f32 {}
 impl Float for f32 {
     #[inline]
     fn max(self, other: f32) -> f32 {
-        unsafe { cmath::c_float::fmax(self, other) }
+        unsafe { cmath::fmaxf(self, other) }
     }
 
     #[inline]
     fn min(self, other: f32) -> f32 {
-        unsafe { cmath::c_float::fmin(self, other) }
+        unsafe { cmath::fminf(self, other) }
     }
 
     #[inline]
diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs
index 4029e111b08..4defa452b5c 100644
--- a/src/libstd/num/f64.rs
+++ b/src/libstd/num/f64.rs
@@ -14,7 +14,6 @@
 
 use prelude::*;
 
-use cmath;
 use default::Default;
 use from_str::FromStr;
 use libc::{c_double, c_int};
@@ -23,6 +22,56 @@ use num::{Zero, One, Bounded, strconv};
 use num;
 use intrinsics;
 
+#[allow(dead_code)]
+mod cmath {
+    use libc::{c_double, c_int};
+
+    #[link_name = "m"]
+    extern {
+        pub fn acos(n: c_double) -> c_double;
+        pub fn asin(n: c_double) -> c_double;
+        pub fn atan(n: c_double) -> c_double;
+        pub fn atan2(a: c_double, b: c_double) -> c_double;
+        pub fn cbrt(n: c_double) -> c_double;
+        pub fn cosh(n: c_double) -> c_double;
+        pub fn erf(n: c_double) -> c_double;
+        pub fn erfc(n: c_double) -> c_double;
+        pub fn expm1(n: c_double) -> c_double;
+        pub fn fdim(a: c_double, b: c_double) -> c_double;
+        pub fn fmax(a: c_double, b: c_double) -> c_double;
+        pub fn fmin(a: c_double, b: c_double) -> c_double;
+        pub fn nextafter(x: c_double, y: c_double) -> c_double;
+        pub fn frexp(n: c_double, value: &mut c_int) -> c_double;
+        pub fn hypot(x: c_double, y: c_double) -> c_double;
+        pub fn ldexp(x: c_double, n: c_int) -> c_double;
+        pub fn logb(n: c_double) -> c_double;
+        pub fn log1p(n: c_double) -> c_double;
+        pub fn ilogb(n: c_double) -> c_int;
+        pub fn modf(n: c_double, iptr: &mut c_double) -> c_double;
+        pub fn sinh(n: c_double) -> c_double;
+        pub fn tan(n: c_double) -> c_double;
+        pub fn tanh(n: c_double) -> c_double;
+        pub fn tgamma(n: c_double) -> c_double;
+
+        // These are commonly only available for doubles
+
+        pub fn j0(n: c_double) -> c_double;
+        pub fn j1(n: c_double) -> c_double;
+        pub fn jn(i: c_int, n: c_double) -> c_double;
+
+        pub fn y0(n: c_double) -> c_double;
+        pub fn y1(n: c_double) -> c_double;
+        pub fn yn(i: c_int, n: c_double) -> c_double;
+
+        #[cfg(unix)]
+        pub fn lgamma_r(n: c_double, sign: &mut c_int) -> c_double;
+        #[cfg(windows)]
+        #[link_name="__lgamma_r"]
+        pub fn lgamma_r(n: c_double, sign: &mut c_int) -> c_double;
+    }
+}
+
+
 macro_rules! delegate(
     (
         $(
@@ -66,29 +115,22 @@ delegate!(
     fn nearbyint(n: f64) -> f64 = intrinsics::nearbyintf64,
     fn round(n: f64) -> f64 = intrinsics::roundf64,
 
-    // cmath
-    fn acos(n: c_double) -> c_double = cmath::c_double::acos,
-    fn asin(n: c_double) -> c_double = cmath::c_double::asin,
-    fn atan(n: c_double) -> c_double = cmath::c_double::atan,
-    fn atan2(a: c_double, b: c_double) -> c_double = cmath::c_double::atan2,
-    fn cbrt(n: c_double) -> c_double = cmath::c_double::cbrt,
-    fn cosh(n: c_double) -> c_double = cmath::c_double::cosh,
-    // fn erf(n: c_double) -> c_double = cmath::c_double::erf,
-    // fn erfc(n: c_double) -> c_double = cmath::c_double::erfc,
-    fn exp_m1(n: c_double) -> c_double = cmath::c_double::exp_m1,
-    fn abs_sub(a: c_double, b: c_double) -> c_double = cmath::c_double::abs_sub,
-    fn next_after(x: c_double, y: c_double) -> c_double = cmath::c_double::next_after,
-    fn frexp(n: c_double, value: &mut c_int) -> c_double = cmath::c_double::frexp,
-    fn hypot(x: c_double, y: c_double) -> c_double = cmath::c_double::hypot,
-    fn ldexp(x: c_double, n: c_int) -> c_double = cmath::c_double::ldexp,
-    // fn log_radix(n: c_double) -> c_double = cmath::c_double::log_radix,
-    fn ln_1p(n: c_double) -> c_double = cmath::c_double::ln_1p,
-    // fn ilog_radix(n: c_double) -> c_int = cmath::c_double::ilog_radix,
-    // fn modf(n: c_double, iptr: &mut c_double) -> c_double = cmath::c_double::modf,
-    // fn ldexp_radix(n: c_double, i: c_int) -> c_double = cmath::c_double::ldexp_radix,
-    fn sinh(n: c_double) -> c_double = cmath::c_double::sinh,
-    fn tan(n: c_double) -> c_double = cmath::c_double::tan,
-    fn tanh(n: c_double) -> c_double = cmath::c_double::tanh
+    fn acos(n: c_double) -> c_double = cmath::acos,
+    fn asin(n: c_double) -> c_double = cmath::asin,
+    fn atan(n: c_double) -> c_double = cmath::atan,
+    fn atan2(a: c_double, b: c_double) -> c_double = cmath::atan2,
+    fn cbrt(n: c_double) -> c_double = cmath::cbrt,
+    fn cosh(n: c_double) -> c_double = cmath::cosh,
+    fn exp_m1(n: c_double) -> c_double = cmath::expm1,
+    fn abs_sub(a: c_double, b: c_double) -> c_double = cmath::fdim,
+    fn next_after(x: c_double, y: c_double) -> c_double = cmath::nextafter,
+    fn frexp(n: c_double, value: &mut c_int) -> c_double = cmath::frexp,
+    fn hypot(x: c_double, y: c_double) -> c_double = cmath::hypot,
+    fn ldexp(x: c_double, n: c_int) -> c_double = cmath::ldexp,
+    fn ln_1p(n: c_double) -> c_double = cmath::log1p,
+    fn sinh(n: c_double) -> c_double = cmath::sinh,
+    fn tan(n: c_double) -> c_double = cmath::tan,
+    fn tanh(n: c_double) -> c_double = cmath::tanh
 )
 
 // FIXME (#1433): obtain these in a different way
@@ -307,12 +349,12 @@ impl Primitive for f64 {}
 impl Float for f64 {
     #[inline]
     fn max(self, other: f64) -> f64 {
-        unsafe { cmath::c_double::fmax(self, other) }
+        unsafe { cmath::fmax(self, other) }
     }
 
     #[inline]
     fn min(self, other: f64) -> f64 {
-        unsafe { cmath::c_double::fmin(self, other) }
+        unsafe { cmath::fmin(self, other) }
     }
 
     #[inline]
diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs
index feff0e7e6c0..2c628112957 100644
--- a/src/libstd/num/mod.rs
+++ b/src/libstd/num/mod.rs
@@ -553,79 +553,6 @@ pub trait Float: Signed + Round + Primitive {
     fn to_radians(&self) -> Self;
 }
 
-/// Returns the exponential of the number, minus `1`, `exp(n) - 1`, in a way
-/// that is accurate even if the number is close to zero.
-#[inline(always)] pub fn exp_m1<T: Float>(value: T) -> T { value.exp_m1() }
-/// Returns the natural logarithm of the number plus `1`, `ln(n + 1)`, more
-/// accurately than if the operations were performed separately.
-#[inline(always)] pub fn ln_1p<T: Float>(value: T) -> T { value.ln_1p() }
-/// Fused multiply-add. Computes `(a * b) + c` with only one rounding error.
-///
-/// This produces a more accurate result with better performance (on some
-/// architectures) than a separate multiplication operation followed by an add.
-#[inline(always)] pub fn mul_add<T: Float>(a: T, b: T, c: T) -> T { a.mul_add(b, c) }
-
-/// Raise a number to a power.
-///
-/// # Example
-///
-/// ```rust
-/// use std::num;
-///
-/// let sixteen: f64 = num::powf(2.0, 4.0);
-/// assert_eq!(sixteen, 16.0);
-/// ```
-#[inline(always)] pub fn powf<T: Float>(value: T, n: T) -> T { value.powf(&n) }
-/// Take the square root of a number.
-#[inline(always)] pub fn sqrt<T: Float>(value: T) -> T { value.sqrt() }
-/// Take the reciprocal (inverse) square root of a number, `1/sqrt(x)`.
-#[inline(always)] pub fn rsqrt<T: Float>(value: T) -> T { value.rsqrt() }
-/// Take the cubic root of a number.
-#[inline(always)] pub fn cbrt<T: Float>(value: T) -> T { value.cbrt() }
-/// Calculate the length of the hypotenuse of a right-angle triangle given legs
-/// of length `x` and `y`.
-#[inline(always)] pub fn hypot<T: Float>(x: T, y: T) -> T { x.hypot(&y) }
-/// Sine function.
-#[inline(always)] pub fn sin<T: Float>(value: T) -> T { value.sin() }
-/// Cosine function.
-#[inline(always)] pub fn cos<T: Float>(value: T) -> T { value.cos() }
-/// Tangent function.
-#[inline(always)] pub fn tan<T: Float>(value: T) -> T { value.tan() }
-/// Compute the arcsine of the number.
-#[inline(always)] pub fn asin<T: Float>(value: T) -> T { value.asin() }
-/// Compute the arccosine of the number.
-#[inline(always)] pub fn acos<T: Float>(value: T) -> T { value.acos() }
-/// Compute the arctangent of the number.
-#[inline(always)] pub fn atan<T: Float>(value: T) -> T { value.atan() }
-/// Compute the arctangent with 2 arguments.
-#[inline(always)] pub fn atan2<T: Float>(x: T, y: T) -> T { x.atan2(&y) }
-/// Simultaneously computes the sine and cosine of the number.
-#[inline(always)] pub fn sin_cos<T: Float>(value: T) -> (T, T) { value.sin_cos() }
-/// Returns `e^(value)`, (the exponential function).
-#[inline(always)] pub fn exp<T: Float>(value: T) -> T { value.exp() }
-/// Returns 2 raised to the power of the number, `2^(value)`.
-#[inline(always)] pub fn exp2<T: Float>(value: T) -> T { value.exp2() }
-/// Returns the natural logarithm of the number.
-#[inline(always)] pub fn ln<T: Float>(value: T) -> T { value.ln() }
-/// Returns the logarithm of the number with respect to an arbitrary base.
-#[inline(always)] pub fn log<T: Float>(value: T, base: T) -> T { value.log(&base) }
-/// Returns the base 2 logarithm of the number.
-#[inline(always)] pub fn log2<T: Float>(value: T) -> T { value.log2() }
-/// Returns the base 10 logarithm of the number.
-#[inline(always)] pub fn log10<T: Float>(value: T) -> T { value.log10() }
-/// Hyperbolic sine function.
-#[inline(always)] pub fn sinh<T: Float>(value: T) -> T { value.sinh() }
-/// Hyperbolic cosine function.
-#[inline(always)] pub fn cosh<T: Float>(value: T) -> T { value.cosh() }
-/// Hyperbolic tangent function.
-#[inline(always)] pub fn tanh<T: Float>(value: T) -> T { value.tanh() }
-/// Inverse hyperbolic sine function.
-#[inline(always)] pub fn asinh<T: Float>(value: T) -> T { value.asinh() }
-/// Inverse hyperbolic cosine function.
-#[inline(always)] pub fn acosh<T: Float>(value: T) -> T { value.acosh() }
-/// Inverse hyperbolic tangent function.
-#[inline(always)] pub fn atanh<T: Float>(value: T) -> T { value.atanh() }
-
 /// A generic trait for converting a value to a number.
 pub trait ToPrimitive {
     /// Converts the value of `self` to an `int`.