Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add traits for primitive numeric types #6071

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/libcore/core.rc
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
pub use iter::{ExtendedMutableIter};

pub use num::{Num, NumCast};
pub use num::{Signed, Unsigned, Integer};
pub use num::{Orderable, Signed, Unsigned, Integer};
pub use num::{Round, Fractional, Real, RealExt};
pub use num::{Bitwise, BitCount, Bounded};
pub use num::{Primitive, Int, Float};

pub use ptr::Ptr;
pub use to_str::ToStr;
pub use clone::Clone;
Expand Down
5 changes: 3 additions & 2 deletions src/libcore/num/cmath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ pub mod c_double_utils {
unsafe fn fmax(a: c_double, b: c_double) -> c_double;
#[link_name="fmin"]
unsafe fn fmin(a: c_double, b: c_double) -> c_double;
unsafe fn nextafter(x: c_double, y: c_double) -> c_double;
#[link_name="nextafter"]
unsafe fn next_after(x: c_double, y: c_double) -> c_double;
unsafe fn frexp(n: c_double, value: &mut c_int) -> c_double;
unsafe fn hypot(x: c_double, y: c_double) -> c_double;
unsafe fn ldexp(x: c_double, n: c_int) -> c_double;
Expand Down Expand Up @@ -131,7 +132,7 @@ pub mod c_float_utils {
#[link_name="fminf"]
unsafe fn fmin(a: c_float, b: c_float) -> c_float;
#[link_name="nextafterf"]
unsafe fn nextafter(x: c_float, y: c_float) -> c_float;
unsafe fn next_after(x: c_float, y: c_float) -> c_float;
#[link_name="hypotf"]
unsafe fn hypot(x: c_float, y: c_float) -> c_float;
#[link_name="ldexpf"]
Expand Down
Loading