Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
24 changes: 17 additions & 7 deletions src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ use num::Float;
use num::FpCategory as Fp;
use option::Option;

#[stable]
#[unstable = "pending integer conventions"]
pub const RADIX: uint = 2u;

#[stable]
#[unstable = "pending integer conventions"]
pub const MANTISSA_DIGITS: uint = 24u;
#[stable]
#[unstable = "pending integer conventions"]
pub const DIGITS: uint = 6u;

#[stable]
Expand All @@ -43,14 +43,14 @@ pub const MIN_POS_VALUE: f32 = 1.17549435e-38_f32;
#[stable]
pub const MAX_VALUE: f32 = 3.40282347e+38_f32;

#[stable]
#[unstable = "pending integer conventions"]
pub const MIN_EXP: int = -125;
#[stable]
#[unstable = "pending integer conventions"]
pub const MAX_EXP: int = 128;

#[stable]
#[unstable = "pending integer conventions"]
pub const MIN_10_EXP: int = -37;
#[stable]
#[unstable = "pending integer conventions"]
pub const MAX_10_EXP: int = 38;

#[stable]
Expand Down Expand Up @@ -177,33 +177,43 @@ impl Float for f32 {
}

#[inline]
#[deprecated]
fn mantissa_digits(_: Option<f32>) -> uint { MANTISSA_DIGITS }

#[inline]
#[deprecated]
fn digits(_: Option<f32>) -> uint { DIGITS }

#[inline]
#[deprecated]
fn epsilon() -> f32 { EPSILON }

#[inline]
#[deprecated]
fn min_exp(_: Option<f32>) -> int { MIN_EXP }

#[inline]
#[deprecated]
fn max_exp(_: Option<f32>) -> int { MAX_EXP }

#[inline]
#[deprecated]
fn min_10_exp(_: Option<f32>) -> int { MIN_10_EXP }

#[inline]
#[deprecated]
fn max_10_exp(_: Option<f32>) -> int { MAX_10_EXP }

#[inline]
#[deprecated]
fn min_value() -> f32 { MIN_VALUE }

#[inline]
#[deprecated]
fn min_pos_value(_: Option<f32>) -> f32 { MIN_POS_VALUE }

#[inline]
#[deprecated]
fn max_value() -> f32 { MAX_VALUE }

/// Returns the mantissa, exponent and sign as integers.
Expand Down
23 changes: 16 additions & 7 deletions src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ use option::Option;
// constants are implemented in favour of referencing the respective
// members of `Bounded` and `Float`.

#[stable]
#[unstable = "pending integer conventions"]
pub const RADIX: uint = 2u;

#[stable]
pub const MANTISSA_DIGITS: uint = 53u;
#[stable]
#[unstable = "pending integer conventions"]
pub const DIGITS: uint = 15u;

#[stable]
Expand All @@ -47,14 +46,14 @@ pub const MIN_POS_VALUE: f64 = 2.2250738585072014e-308_f64;
#[stable]
pub const MAX_VALUE: f64 = 1.7976931348623157e+308_f64;

#[stable]
#[unstable = "pending integer conventions"]
pub const MIN_EXP: int = -1021;
#[stable]
#[unstable = "pending integer conventions"]
pub const MAX_EXP: int = 1024;

#[stable]
#[unstable = "pending integer conventions"]
pub const MIN_10_EXP: int = -307;
#[stable]
#[unstable = "pending integer conventions"]
pub const MAX_10_EXP: int = 308;

#[stable]
Expand Down Expand Up @@ -185,33 +184,43 @@ impl Float for f64 {
}

#[inline]
#[deprecated]
fn mantissa_digits(_: Option<f64>) -> uint { MANTISSA_DIGITS }

#[inline]
#[deprecated]
fn digits(_: Option<f64>) -> uint { DIGITS }

#[inline]
#[deprecated]
fn epsilon() -> f64 { EPSILON }

#[inline]
#[deprecated]
fn min_exp(_: Option<f64>) -> int { MIN_EXP }

#[inline]
#[deprecated]
fn max_exp(_: Option<f64>) -> int { MAX_EXP }

#[inline]
#[deprecated]
fn min_10_exp(_: Option<f64>) -> int { MIN_10_EXP }

#[inline]
#[deprecated]
fn max_10_exp(_: Option<f64>) -> int { MAX_10_EXP }

#[inline]
#[deprecated]
fn min_value() -> f64 { MIN_VALUE }

#[inline]
#[deprecated]
fn min_pos_value(_: Option<f64>) -> f64 { MIN_POS_VALUE }

#[inline]
#[deprecated]
fn max_value() -> f64 { MAX_VALUE }

/// Returns the mantissa, exponent and sign as integers.
Expand Down
Loading