about summary refs log tree commit diff
path: root/src/libstd/num
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-11-15 22:03:34 -0800
committerAaron Turon <aturon@mozilla.com>2014-11-18 20:07:58 -0800
commitbdbc09ad484847378b87ee8d60096cd39d8fb47a (patch)
treeb56e9cd604bd377d24ac9ec3c307359f8b987ce0 /src/libstd/num
parente09d98603e608c9e47d4c89f7b4dca87a4b56da3 (diff)
downloadrust-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')
-rw-r--r--src/libstd/num/f32.rs10
-rw-r--r--src/libstd/num/f64.rs10
-rw-r--r--src/libstd/num/i16.rs2
-rw-r--r--src/libstd/num/i32.rs2
-rw-r--r--src/libstd/num/i64.rs2
-rw-r--r--src/libstd/num/i8.rs2
-rw-r--r--src/libstd/num/mod.rs4
-rw-r--r--src/libstd/num/u16.rs2
-rw-r--r--src/libstd/num/u32.rs2
-rw-r--r--src/libstd/num/u64.rs2
-rw-r--r--src/libstd/num/u8.rs2
11 files changed, 29 insertions, 11 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);
diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs
index 543d50596e8..29ccfe512b9 100644
--- a/src/libstd/num/f64.rs
+++ b/src/libstd/num/f64.rs
@@ -10,7 +10,7 @@
 
 //! Operations and constants for 64-bits floats (`f64` type)
 
-#![experimental]
+#![stable]
 #![allow(missing_docs)]
 #![doc(primitive = "f64")]
 
@@ -76,6 +76,7 @@ mod cmath {
     }
 }
 
+#[unstable = "trait is unstable"]
 impl FloatMath for f64 {
     /// Constructs a floating point number by multiplying `x` by 2 raised to the
     /// power of `exp`
@@ -256,6 +257,7 @@ impl FloatMath for f64 {
 ///
 /// * num - The float value
 #[inline]
+#[experimental = "may be removed or relocated"]
 pub fn to_string(num: f64) -> String {
     let (r, _) = strconv::float_to_str_common(
         num, 10u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false);
@@ -268,6 +270,7 @@ pub fn to_string(num: f64) -> String {
 ///
 /// * num - The float value
 #[inline]
+#[experimental = "may be removed or relocated"]
 pub fn to_str_hex(num: f64) -> String {
     let (r, _) = strconv::float_to_str_common(
         num, 16u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false);
@@ -282,6 +285,7 @@ pub fn to_str_hex(num: f64) -> String {
 /// * num - The float value
 /// * radix - The base to use
 #[inline]
+#[experimental = "may be removed or relocated"]
 pub fn to_str_radix_special(num: f64, rdx: uint) -> (String, bool) {
     strconv::float_to_str_common(num, rdx, true,
                            strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false)
@@ -295,6 +299,7 @@ pub fn to_str_radix_special(num: f64, 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: f64, dig: uint) -> String {
     let (r, _) = strconv::float_to_str_common(
         num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpNone, false);
@@ -309,6 +314,7 @@ pub fn to_str_exact(num: f64, 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: f64, dig: uint) -> String {
     let (r, _) = strconv::float_to_str_common(
         num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpNone, false);
@@ -324,6 +330,7 @@ pub fn to_str_digits(num: f64, 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: f64, dig: uint, upper: bool) -> String {
     let (r, _) = strconv::float_to_str_common(
         num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpDec, upper);
@@ -339,6 +346,7 @@ pub fn to_str_exp_exact(num: f64, 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: f64, dig: uint, upper: bool) -> String {
     let (r, _) = strconv::float_to_str_common(
         num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpDec, upper);
diff --git a/src/libstd/num/i16.rs b/src/libstd/num/i16.rs
index 6455c10736a..333d1d7df0b 100644
--- a/src/libstd/num/i16.rs
+++ b/src/libstd/num/i16.rs
@@ -10,7 +10,7 @@
 
 //! Operations and constants for signed 16-bits integers (`i16` type)
 
-#![unstable]
+#![stable]
 #![doc(primitive = "i16")]
 
 pub use core::i16::{BITS, BYTES, MIN, MAX};
diff --git a/src/libstd/num/i32.rs b/src/libstd/num/i32.rs
index 39b179c8274..44b5397bf74 100644
--- a/src/libstd/num/i32.rs
+++ b/src/libstd/num/i32.rs
@@ -10,7 +10,7 @@
 
 //! Operations and constants for signed 32-bits integers (`i32` type)
 
-#![unstable]
+#![stable]
 #![doc(primitive = "i32")]
 
 pub use core::i32::{BITS, BYTES, MIN, MAX};
diff --git a/src/libstd/num/i64.rs b/src/libstd/num/i64.rs
index a0c474c479a..de6fa0d3ef8 100644
--- a/src/libstd/num/i64.rs
+++ b/src/libstd/num/i64.rs
@@ -10,7 +10,7 @@
 
 //! Operations and constants for signed 64-bits integers (`i64` type)
 
-#![unstable]
+#![stable]
 #![doc(primitive = "i64")]
 
 pub use core::i64::{BITS, BYTES, MIN, MAX};
diff --git a/src/libstd/num/i8.rs b/src/libstd/num/i8.rs
index e911ed1de9a..3b9fbcb768b 100644
--- a/src/libstd/num/i8.rs
+++ b/src/libstd/num/i8.rs
@@ -10,7 +10,7 @@
 
 //! Operations and constants for signed 8-bits integers (`i8` type)
 
-#![unstable]
+#![stable]
 #![doc(primitive = "i8")]
 
 pub use core::i8::{BITS, BYTES, MIN, MAX};
diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs
index f49b2b0deed..a15e71b4a2a 100644
--- a/src/libstd/num/mod.rs
+++ b/src/libstd/num/mod.rs
@@ -13,7 +13,7 @@
 //! These are implemented for the primitive numeric types in `std::{u8, u16,
 //! u32, u64, uint, i8, i16, i32, i64, int, f32, f64}`.
 
-#![experimental]
+#![stable]
 #![allow(missing_docs)]
 
 #[cfg(test)] use cmp::PartialEq;
@@ -33,9 +33,11 @@ pub use core::num::{FromStrRadix, from_str_radix};
 pub use core::num::{FPCategory, FPNaN, FPInfinite, FPZero, FPSubnormal};
 pub use core::num::{FPNormal, Float};
 
+#[experimental = "may be removed or relocated"]
 pub mod strconv;
 
 /// Mathematical operations on primitive floating point numbers.
+#[unstable = "may be altered to inline the Float trait"]
 pub trait FloatMath: Float {
     /// Constructs a floating point number created by multiplying `x` by 2
     /// raised to the power of `exp`.
diff --git a/src/libstd/num/u16.rs b/src/libstd/num/u16.rs
index 246224ddb2b..a83a66c23a5 100644
--- a/src/libstd/num/u16.rs
+++ b/src/libstd/num/u16.rs
@@ -10,7 +10,7 @@
 
 //! Operations and constants for unsigned 16-bits integers (`u16` type)
 
-#![unstable]
+#![stable]
 #![doc(primitive = "u16")]
 
 pub use core::u16::{BITS, BYTES, MIN, MAX};
diff --git a/src/libstd/num/u32.rs b/src/libstd/num/u32.rs
index 143b45010c2..7271203b23b 100644
--- a/src/libstd/num/u32.rs
+++ b/src/libstd/num/u32.rs
@@ -10,7 +10,7 @@
 
 //! Operations and constants for unsigned 32-bits integers (`u32` type)
 
-#![unstable]
+#![stable]
 #![doc(primitive = "u32")]
 
 pub use core::u32::{BITS, BYTES, MIN, MAX};
diff --git a/src/libstd/num/u64.rs b/src/libstd/num/u64.rs
index 92c5380f980..25de2f3b255 100644
--- a/src/libstd/num/u64.rs
+++ b/src/libstd/num/u64.rs
@@ -10,7 +10,7 @@
 
 //! Operations and constants for unsigned 64-bits integer (`u64` type)
 
-#![unstable]
+#![stable]
 #![doc(primitive = "u64")]
 
 pub use core::u64::{BITS, BYTES, MIN, MAX};
diff --git a/src/libstd/num/u8.rs b/src/libstd/num/u8.rs
index faa6d167065..22dedeecf3b 100644
--- a/src/libstd/num/u8.rs
+++ b/src/libstd/num/u8.rs
@@ -10,7 +10,7 @@
 
 //! Operations and constants for unsigned 8-bits integers (`u8` type)
 
-#![unstable]
+#![stable]
 #![doc(primitive = "u8")]
 
 pub use core::u8::{BITS, BYTES, MIN, MAX};