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).
This commit is contained in:
Brendan Zabarauskas 2014-01-13 10:32:50 +11:00
parent 0091a15a43
commit 1246f0b094
2 changed files with 1 additions and 49 deletions

View File

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

View File

@ -324,24 +324,6 @@ pub trait Real: Signed
/// Inverse hyperbolic tangent function.
#[inline(always)] pub fn atanh<T: Real>(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<Self>
+ BitAnd<Self,Self>