diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-11-15 22:03:34 -0800 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-11-18 20:07:58 -0800 |
| commit | bdbc09ad484847378b87ee8d60096cd39d8fb47a (patch) | |
| tree | b56e9cd604bd377d24ac9ec3c307359f8b987ce0 /src/libstd/num/f32.rs | |
| parent | e09d98603e608c9e47d4c89f7b4dca87a4b56da3 (diff) | |
| download | rust-bdbc09ad484847378b87ee8d60096cd39d8fb47a.tar.gz rust-bdbc09ad484847378b87ee8d60096cd39d8fb47a.zip | |
libs: stabilize most numerics after RFC changes
This commit adds stability markers for the APIs that have recently been aligned with [numerics reform](https://github.com/rust-lang/rfcs/pull/369). For APIs that were changed as part of that reform, `#[unstable]` is used to reflect the recency, but the APIs will become `#[stable]` in a follow-up pass. In addition, a few aspects of the APIs not explicitly covered by the RFC are marked here -- in particular, constants for floats. This commit does not mark the `uint` or `int` modules as `#[stable]`, given the ongoing debate out the names and roles of these types. Due to some deprecation (see the RFC for details), this is a: [breaking-change]
Diffstat (limited to 'src/libstd/num/f32.rs')
| -rw-r--r-- | src/libstd/num/f32.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index 207fa649930..9aac857bb65 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -10,7 +10,7 @@ //! Operations and constants for 32-bits floats (`f32` type) -#![experimental] +#![stable] #![allow(missing_docs)] #![allow(unsigned_negation)] #![doc(primitive = "f32")] @@ -68,6 +68,7 @@ mod cmath { } } +#[unstable = "trait is unstable"] impl FloatMath for f32 { /// Constructs a floating point number by multiplying `x` by 2 raised to the /// power of `exp` @@ -248,6 +249,7 @@ impl FloatMath for f32 { /// /// * num - The float value #[inline] +#[experimental = "may be removed or relocated"] pub fn to_string(num: f32) -> String { let (r, _) = strconv::float_to_str_common( num, 10u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false); @@ -260,6 +262,7 @@ pub fn to_string(num: f32) -> String { /// /// * num - The float value #[inline] +#[experimental = "may be removed or relocated"] pub fn to_str_hex(num: f32) -> String { let (r, _) = strconv::float_to_str_common( num, 16u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false); @@ -274,6 +277,7 @@ pub fn to_str_hex(num: f32) -> String { /// * num - The float value /// * radix - The base to use #[inline] +#[experimental = "may be removed or relocated"] pub fn to_str_radix_special(num: f32, rdx: uint) -> (String, bool) { strconv::float_to_str_common(num, rdx, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false) @@ -287,6 +291,7 @@ pub fn to_str_radix_special(num: f32, rdx: uint) -> (String, bool) { /// * num - The float value /// * digits - The number of significant digits #[inline] +#[experimental = "may be removed or relocated"] pub fn to_str_exact(num: f32, dig: uint) -> String { let (r, _) = strconv::float_to_str_common( num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpNone, false); @@ -301,6 +306,7 @@ pub fn to_str_exact(num: f32, dig: uint) -> String { /// * num - The float value /// * digits - The number of significant digits #[inline] +#[experimental = "may be removed or relocated"] pub fn to_str_digits(num: f32, dig: uint) -> String { let (r, _) = strconv::float_to_str_common( num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpNone, false); @@ -316,6 +322,7 @@ pub fn to_str_digits(num: f32, dig: uint) -> String { /// * digits - The number of digits after the decimal point /// * upper - Use `E` instead of `e` for the exponent sign #[inline] +#[experimental = "may be removed or relocated"] pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpDec, upper); @@ -331,6 +338,7 @@ pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> String { /// * digits - The number of digits after the decimal point /// * upper - Use `E` instead of `e` for the exponent sign #[inline] +#[experimental = "may be removed or relocated"] pub fn to_str_exp_digits(num: f32, dig: uint, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpDec, upper); |
