Skip to content

Commit 1246f0b

Browse files
committed
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).
1 parent 0091a15 commit 1246f0b

File tree

2 files changed

+1
-49
lines changed

2 files changed

+1
-49
lines changed

src/libstd/num/f64.rs

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use cmath::c_double_utils;
1818
use default::Default;
1919
use libc::{c_double, c_int};
2020
use num::{FPCategory, FPNaN, FPInfinite , FPZero, FPSubnormal, FPNormal};
21-
use num::{Zero, One, RealExt, strconv};
21+
use num::{Zero, One, strconv};
2222
use num;
2323
use to_str;
2424
use unstable::intrinsics;
@@ -560,36 +560,6 @@ impl Real for f64 {
560560
}
561561
}
562562

563-
impl RealExt for f64 {
564-
#[inline]
565-
fn lgamma(&self) -> (int, f64) {
566-
let mut sign = 0;
567-
let result = lgamma(*self, &mut sign);
568-
(sign as int, result)
569-
}
570-
571-
#[inline]
572-
fn tgamma(&self) -> f64 { tgamma(*self) }
573-
574-
#[inline]
575-
fn j0(&self) -> f64 { j0(*self) }
576-
577-
#[inline]
578-
fn j1(&self) -> f64 { j1(*self) }
579-
580-
#[inline]
581-
fn jn(&self, n: int) -> f64 { jn(n as c_int, *self) }
582-
583-
#[inline]
584-
fn y0(&self) -> f64 { y0(*self) }
585-
586-
#[inline]
587-
fn y1(&self) -> f64 { y1(*self) }
588-
589-
#[inline]
590-
fn yn(&self, n: int) -> f64 { yn(n as c_int, *self) }
591-
}
592-
593563
impl Bounded for f64 {
594564
#[inline]
595565
fn min_value() -> f64 { 2.2250738585072014e-308 }

src/libstd/num/mod.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -324,24 +324,6 @@ pub trait Real: Signed
324324
/// Inverse hyperbolic tangent function.
325325
#[inline(always)] pub fn atanh<T: Real>(value: T) -> T { value.atanh() }
326326

327-
/// Methods that are harder to implement and not commonly used.
328-
pub trait RealExt: Real {
329-
// FIXME (#5527): usages of `int` should be replaced with an associated
330-
// integer type once these are implemented
331-
332-
// Gamma functions
333-
fn lgamma(&self) -> (int, Self);
334-
fn tgamma(&self) -> Self;
335-
336-
// Bessel functions
337-
fn j0(&self) -> Self;
338-
fn j1(&self) -> Self;
339-
fn jn(&self, n: int) -> Self;
340-
fn y0(&self) -> Self;
341-
fn y1(&self) -> Self;
342-
fn yn(&self, n: int) -> Self;
343-
}
344-
345327
/// Collects the bitwise operators under one trait.
346328
pub trait Bitwise: Not<Self>
347329
+ BitAnd<Self,Self>

0 commit comments

Comments
 (0)