Skip to content

Commit b0ce960

Browse files
committed
auto merge of #12321 : bjz/rust/remove-real, r=alexcrichton
This is part of the effort to simplify `std::num`, as tracked in issue #10387. It is also a step towards a proper IEEE-754 trait (see #12281).
2 parents 62d7d00 + 876eb93 commit b0ce960

File tree

9 files changed

+501
-511
lines changed

9 files changed

+501
-511
lines changed

src/etc/vim/syntax/rust.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator Cloneabl
8585
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
8686

8787
syn keyword rustTrait Algebraic Trigonometric Exponential Hyperbolic
88-
syn keyword rustTrait Bitwise Bounded Integer Fractional Real RealExt
88+
syn keyword rustTrait Bitwise Bounded Integer
8989
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv
9090
syn keyword rustTrait Orderable Signed Unsigned Round
9191
syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive

src/libnum/complex.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ impl<T: Clone + Num> Cmplx<T> {
7777
}
7878
}
7979

80-
impl<T: Clone + Real> Cmplx<T> {
80+
impl<T: Clone + Float> Cmplx<T> {
8181
/// Calculate |self|
8282
#[inline]
8383
pub fn norm(&self) -> T {
8484
self.re.hypot(&self.im)
8585
}
8686
}
8787

88-
impl<T: Clone + Real> Cmplx<T> {
88+
impl<T: Clone + Float> Cmplx<T> {
8989
/// Calculate the principal Arg of self.
9090
#[inline]
9191
pub fn arg(&self) -> T {
@@ -192,7 +192,7 @@ mod test {
192192
#[allow(non_uppercase_statics)];
193193

194194
use super::{Complex64, Cmplx};
195-
use std::num::{Zero,One,Real};
195+
use std::num::{Zero,One,Float};
196196

197197
pub static _0_0i : Complex64 = Cmplx { re: 0.0, im: 0.0 };
198198
pub static _1_0i : Complex64 = Cmplx { re: 1.0, im: 0.0 };
@@ -270,9 +270,9 @@ mod test {
270270
assert!((c.arg() - arg).abs() < 1.0e-6)
271271
}
272272
test(_1_0i, 0.0);
273-
test(_1_1i, 0.25 * Real::pi());
274-
test(_neg1_1i, 0.75 * Real::pi());
275-
test(_05_05i, 0.25 * Real::pi());
273+
test(_1_1i, 0.25 * Float::pi());
274+
test(_neg1_1i, 0.75 * Float::pi());
275+
test(_05_05i, 0.25 * Float::pi());
276276
}
277277

278278
#[test]

0 commit comments

Comments
 (0)