From 1246f0b09441d47cdf29d0d7852a1d1a87533756 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Mon, 13 Jan 2014 10:32:50 +1100 Subject: [PATCH] Remove RealExt These functions are of little utility outside a small subset of use cases. If people need them for their own projects then they can use their own bindings for libm (which aren't hard to make). --- src/libstd/num/f64.rs | 32 +------------------------------- src/libstd/num/mod.rs | 18 ------------------ 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index 6c80998e8d7..1ab76a97b62 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -18,7 +18,7 @@ use cmath::c_double_utils; use default::Default; use libc::{c_double, c_int}; use num::{FPCategory, FPNaN, FPInfinite , FPZero, FPSubnormal, FPNormal}; -use num::{Zero, One, RealExt, strconv}; +use num::{Zero, One, strconv}; use num; use to_str; use unstable::intrinsics; @@ -560,36 +560,6 @@ impl Real for f64 { } } -impl RealExt for f64 { - #[inline] - fn lgamma(&self) -> (int, f64) { - let mut sign = 0; - let result = lgamma(*self, &mut sign); - (sign as int, result) - } - - #[inline] - fn tgamma(&self) -> f64 { tgamma(*self) } - - #[inline] - fn j0(&self) -> f64 { j0(*self) } - - #[inline] - fn j1(&self) -> f64 { j1(*self) } - - #[inline] - fn jn(&self, n: int) -> f64 { jn(n as c_int, *self) } - - #[inline] - fn y0(&self) -> f64 { y0(*self) } - - #[inline] - fn y1(&self) -> f64 { y1(*self) } - - #[inline] - fn yn(&self, n: int) -> f64 { yn(n as c_int, *self) } -} - impl Bounded for f64 { #[inline] fn min_value() -> f64 { 2.2250738585072014e-308 } diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index 1369df27565..2bf3158e6b4 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -324,24 +324,6 @@ pub trait Real: Signed /// Inverse hyperbolic tangent function. #[inline(always)] pub fn atanh(value: T) -> T { value.atanh() } -/// Methods that are harder to implement and not commonly used. -pub trait RealExt: Real { - // FIXME (#5527): usages of `int` should be replaced with an associated - // integer type once these are implemented - - // Gamma functions - fn lgamma(&self) -> (int, Self); - fn tgamma(&self) -> Self; - - // Bessel functions - fn j0(&self) -> Self; - fn j1(&self) -> Self; - fn jn(&self, n: int) -> Self; - fn y0(&self) -> Self; - fn y1(&self) -> Self; - fn yn(&self, n: int) -> Self; -} - /// Collects the bitwise operators under one trait. pub trait Bitwise: Not + BitAnd