Module num

1.6.0 Β· Source
Expand description

Numeric traits and functions for the built-in numeric types.

Re-exportsΒ§

pub use dec2flt::ParseFloatError;
pub use error::IntErrorKind;
pub use error::ParseIntError;
pub use error::TryFromIntError;
pub use nonzero::NonZero;
pub use nonzero::NonZeroI8;
pub use nonzero::NonZeroI16;
pub use nonzero::NonZeroI32;
pub use nonzero::NonZeroI64;
pub use nonzero::NonZeroI128;
pub use nonzero::NonZeroIsize;
pub use nonzero::NonZeroU8;
pub use nonzero::NonZeroU16;
pub use nonzero::NonZeroU32;
pub use nonzero::NonZeroU64;
pub use nonzero::NonZeroU128;
pub use nonzero::NonZeroUsize;
pub use saturating::Saturating;
pub use wrapping::Wrapping;
pub use nonzero::ZeroablePrimitive;Experimental

ModulesΒ§

error πŸ”’
Error types for conversion to integral types.
int_log10 πŸ”’
int_macros πŸ”’
int_sqrt πŸ”’
These functions use the Karatsuba square root algorithm to compute the integer square root for the primitive integer types.
nonzero πŸ”’
Definitions of integer that is known not to equal zero.
overflow_panic πŸ”’
Functions for panicking on overflow.
saturating πŸ”’
Definitions of Saturating<T>.
uint_macros πŸ”’
wrapping πŸ”’
Definitions of Wrapping<T>.
bignum πŸ‘» Experimental
Custom arbitrary-precision number (bignum) implementation.
dec2flt πŸ‘» Experimental
Converting decimal strings into IEEE 754 binary floating point numbers.
diy_float πŸ‘» Experimental
Extended precision β€œsoft float”, for internal use only.
flt2dec πŸ‘» Experimental
Floating-point number to decimal conversion routines.
fmt πŸ‘» Experimental
Shared utilities used by both float and integer formatting.
niche_types πŸ‘» Experimental
100% perma-unstable

MacrosΒ§

from_str_int_impl πŸ”’
i8_xe_bytes_doc πŸ”’
midpoint_impl πŸ”’
sign_dependent_expr πŸ”’
try_opt πŸ”’
u8_xe_bytes_doc πŸ”’
usize_isize_from_xe_bytes_doc πŸ”’
usize_isize_to_xe_bytes_doc πŸ”’

EnumsΒ§

FpCategory
A classification of floating point numbers.

ConstantsΒ§

ASCII_CASE_MASK πŸ”’
If the bit selected by this mask is set, ascii is lower case.

FunctionsΒ§

from_ascii_radix_panic πŸ”’
can_not_overflow πŸ‘» Experimental
Determines if a string of text of that length of that radix could be guaranteed to be stored in the given type T. Note that if the radix is known to the compiler, it is just the check of digits.len that is done at runtime.