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

Some docs for std::num #31520

Merged
merged 1 commit into from
Feb 10, 2016
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
7 changes: 7 additions & 0 deletions src/libcore/num/dec2flt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ from_str_float_impl!(f32);
from_str_float_impl!(f64);

/// An error which can be returned when parsing a float.
///
/// This error is used as the error type for the [`FromStr`] implementation
/// for [`f32`] and [`f64`].
///
/// [`FromStr`]: ../str/trait.FromStr.html
/// [`f32`]: ../primitive.f32.html
/// [`f64`]: ../primitive.f64.html
#[derive(Debug, Clone, PartialEq)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct ParseFloatError {
Expand Down
13 changes: 12 additions & 1 deletion src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2160,7 +2160,13 @@ impl usize {
intrinsics::mul_with_overflow }
}

/// Used for representing the classification of floating point numbers
/// A classification of floating point numbers.
///
/// This `enum` is used as the return type for [`f32::classify()`] and [`f64::classify()`]. See
/// their documentation for more.
///
/// [`f32::classify()`]: ../primitive.f32.html#method.classify
/// [`f64::classify()`]: ../primitive.f64.html#method.classify
#[derive(Copy, Clone, PartialEq, Debug)]
#[stable(feature = "rust1", since = "1.0.0")]
pub enum FpCategory {
Expand Down Expand Up @@ -2387,6 +2393,11 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32)
}

/// An error which can be returned when parsing an integer.
///
/// This error is used as the error type for the `from_str_radix()` functions
/// on the primitive integer types, such as [`i8::from_str_radix()`].
///
/// [`i8::from_str_radix()`]: ../std/primitive.i8.html#method.from_str_radix
#[derive(Debug, Clone, PartialEq)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct ParseIntError { kind: IntErrorKind }
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Numeric traits and functions for generic mathematics
//! Additional functionality for numerics.
//!
//! These are implemented for the primitive numeric types in `std::{u8, u16,
//! u32, u64, usize, i8, i16, i32, i64, isize, f32, f64}`.
//! This module provides some extra types that are useful when doing numerical
//! work. See the individual documentation for each piece for more information.

#![stable(feature = "rust1", since = "1.0.0")]
#![allow(missing_docs)]
Expand Down