summary refs log tree commit diff
path: root/src/libstd/num/strconv.rs
AgeCommit message (Collapse)AuthorLines
2013-09-23std: merge rand::{Rng,RngUtil} with default methods.Huon Wilson-1/+1
Also, documentation & general clean-up: - remove `gen_char_from`: better served by `sample` or `choose`. - `gen_bytes` generalised to `gen_vec`. - `gen_int_range`/`gen_uint_range` merged into `gen_integer_range` and made to be properly uniformly distributed. Fixes #8644. Minor adjustments to other functions.
2013-09-19Rename the NaN and is_NaN methods to lowercase.Chris Morgan-4/+4
This is for consistency in naming conventions. - ``std::num::Float::NaN()`` is changed to ``nan()``; - ``std::num::Float.is_NaN()`` is changed to ``is_nan()``; and - ``std::num::strconv::NumStrConv::NaN()`` is changed to ``nan()``. Fixes #9319.
2013-09-06auto merge of #9010 : aaronlaursen/rust/master, r=alexcrichtonbors-4/+31
Here's a fix for issue #7588, "Overflow handling of from_str methods is broken". The integer overflow issues are taken care of by checking to see if the multiply-by-radix-and-add-next-digit process is reversible. If it overflowed, then some information is lost and the process is irreversible, in which case, None is returned. Floats now consistently return Some(Inf) of Some(-Inf) on overflow thanks to a call to NumStrConv::inf() and NumStrConv::neg_inf() respectively when the overflow is detected (which yields a value of None in the case of ints and uints anyway). This is my first contribution to Rust, and my first time using the language in general, so any and all feedback is appreciated.
2013-09-06fix for issue #7588, overflow now handled correctlyAaron Laursen-4/+31
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-1/+1
2013-08-20rm obsolete integer to_str{,_radix} free functionsDaniel Micay-2/+2
2013-08-07Forbid `priv` where it has no effectAlex Crichton-3/+3
This is everywhere except struct fields and enum variants.
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-1/+1
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-07-22std: add #[bench] benchmarks for num::strconvGraydon Hoare-0/+24
2013-07-19std: Remove old magic core modBrian Anderson-1/+1
2013-07-17librustc: Remove all uses of the `Copy` bound.Patrick Walton-4/+3
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-9/+10
2013-07-01rustc: add a lint to enforce uppercase statics.Huon Wilson-7/+7
2013-06-30auto merge of #7487 : huonw/rust/vec-kill, r=cmrbors-3/+2
Continuation of #7430. I haven't removed the `map` method, since the replacement `v.iter().transform(f).collect::<~[SomeType]>()` is a little ridiculous at the moment.
2013-06-30Specialize to_str_common for floats/integers in strconvAlex Crichton-83/+113
This allows the integral paths to avoid allocations on the heap Closes #4424, #4423
2013-06-30Convert vec::{reverse, swap} to methods.Huon Wilson-3/+2
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-18/+18
2013-06-16Add copies to type params with Copy boundNiko Matsakis-14/+14
2013-06-12std: unify the str -> [u8] functions as 3 methods: .as_bytes() and ↵Huon Wilson-6/+7
.as_bytes_with_null[_consume](). The first acts on &str and is not nul-terminated, the last two act on strings that are always null terminated (&'static str, ~str and @str).
2013-05-30Require documentation by default for libstdAlex Crichton-0/+2
Adds documentation for various things that I understand. Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+673
This only changes the directory names; it does not change the "real" metadata names.