about summary refs log tree commit diff
path: root/src/libnum
AgeCommit message (Collapse)AuthorLines
2014-04-11libtest: rename `BenchHarness` to `Bencher`Liigo Zhuang-10/+10
Closes #12640
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-3/+3
port all code over to use it.
2014-04-03Bump version to 0.11-preBrian Anderson-1/+1
This also changes some of the download links in the documentation to 'nightly'.
2014-04-03auto merge of #13286 : alexcrichton/rust/release, r=brsonbors-1/+1
Merging the 0.10 release into the master branch.
2014-04-01make Cmplx fields publicTed Horst-2/+2
2014-03-31num: Switch field privacy as necessaryAlex Crichton-5/+5
2014-03-31Bump version to 0.10Alex Crichton-1/+1
2014-03-31vec: convert `append` and `append_one` to methodsDaniel Micay-3/+1
These were only free functions on `~[T]` because taking self by-value used to be broken.
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-10/+10
Closes #2569
2014-03-25Changed `iter::Extendable` and `iter::FromIterator` to take a `Iterator` by ↵Marvin Löbel-1/+1
value
2014-03-24Correct issue workaround referencesSteven Stewart-Gallus-11/+10
2014-03-23std: remove the `equals` method from `TotalEq`.Huon Wilson-38/+9
`TotalEq` is now just an assertion about the `Eq` impl of a type (i.e. `==` is a total equality if a type implements `TotalEq`) so the extra method is just confusing. Also, a new method magically appeared as a hack to allow deriving to assert that the contents of a struct/enum are also TotalEq, because the deriving infrastructure makes it very hard to do anything but create a trait method. (You didn't hear about this horrible work-around from me :(.)
2014-03-22Add #[deny(deprecated_owned_vector)] to several modules.Huon Wilson-0/+2
2014-03-21test: Make manual changes to deal with the fallout from removal ofPatrick Walton-5/+6
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-5/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-6/+6
Closes #12771
2014-03-18Docify std::vec_ngSteven Fackler-2/+2
I also removed a couple of methods that were silly and added sort.
2014-03-16num: Migrate `~[T]` to `std::vec_ng::Vec`Florian Zeitz-148/+150
2014-03-16num: Slightly optimize bigintFlorian Zeitz-44/+32
2014-03-15Add rustdoc html crate infoSteven Fackler-0/+3
2014-03-14lint: add lint for use of a `~[T]`.Huon Wilson-0/+1
This is useless at the moment (since pretty much every crate uses `~[]`), but should help avoid regressions once completely removed from a crate.
2014-03-13Implement automatic overloaded dereference.Eduard Burtescu-1/+1
Closes #7141.
2014-03-12Update users for the std::rand -> librand move.Huon Wilson-3/+5
2014-03-04Rename all variables that have uppercase characters in their names to use ↵Palmer Cox-67/+67
only lowercase characters
2014-03-03Implemented checked arithmetic for Big(U)IntsTorstenWeber-0/+233
2014-02-28std: Change assert_eq!() to use {} instead of {:?}Alex Crichton-1/+1
Formatting via reflection has been a little questionable for some time now, and it's a little unfortunate that one of the standard macros will silently use reflection when you weren't expecting it. This adds small bits of code bloat to libraries, as well as not always being necessary. In light of this information, this commit switches assert_eq!() to using {} in the error message instead of {:?}. In updating existing code, there were a few error cases that I encountered: * It's impossible to define Show for [T, ..N]. I think DST will alleviate this because we can define Show for [T]. * A few types here and there just needed a #[deriving(Show)] * Type parameters needed a Show bound, I often moved this to `assert!(a == b)` * `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths. I don't think this is much of a regression though because {:?} on paths looks awful (it's a byte array). Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime significant for smaller binaries.
2014-02-24Remove std::num::ToStrRadix from the preludeBrendan Zabarauskas-3/+3
2014-02-24Remove std::from_str::FromStr from the preludeBrendan Zabarauskas-0/+2
2014-02-24Move extra::json to libserializeAlex Crichton-2/+0
This also inverts the dependency between libserialize and libcollections. cc #8784
2014-02-23Remove all ToStr impls, add Show implsAlex Crichton-16/+20
This commit changes the ToStr trait to: impl<T: fmt::Show> ToStr for T { fn to_str(&self) -> ~str { format!("{}", *self) } } The ToStr trait has been on the chopping block for quite awhile now, and this is the final nail in its coffin. The trait and the corresponding method are not being removed as part of this commit, but rather any implementations of the `ToStr` trait are being forbidden because of the generic impl. The new way to get the `to_str()` method to work is to implement `fmt::Show`. Formatting into a `&mut Writer` (as `format!` does) is much more efficient than `ToStr` when building up large strings. The `ToStr` trait forces many intermediate allocations to be made while the `fmt::Show` trait allows incremental buildup in the same heap allocated buffer. Additionally, the `fmt::Show` trait is much more extensible in terms of interoperation with other `Writer` instances and in more situations. By design the `ToStr` trait requires at least one allocation whereas the `fmt::Show` trait does not require any allocations. Closes #8242 Closes #9806
2014-02-22Move std::num::Integer to libnumBrendan Zabarauskas-2/+408
2014-02-20auto merge of #12343 : liigo/rust/move-extra-test-to-libtest, r=alexcrichtonbors-4/+4
I don't think `extra` is a good/meaningful name for a library. `libextra` should disappear, and we move all of its sub modules out of it. This PR is just one of that steps: move `extra::test` to `libtest`. I didn't add `libtest` to doc index, because it's an internal library currently. **Update:** All comments addressed. All tests passed. Rebased and squashed.
2014-02-20move extra::test to libtestLiigo Zhuang-4/+4
2014-02-19auto merge of #12392 : aepsil0n/rust/fix/pub_randbigint, r=huonwbors-1/+1
Closes #12383. Test suite did not capture this and can't as long as it is in the same module hierarchy. This is probably something that should be addressed in the future.
2014-02-19librustc: Remove unique vector patterns from the language.Patrick Walton-25/+18
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.
2014-02-19libnum: Make RandBigInt trait publicEduard Bopp-1/+1
Closes #12383.
2014-02-17Remove Real trait and move methods into FloatBrendan Zabarauskas-6/+6
This is part of the effort to simplify `std::num`, as tracked in issue #10387.
2014-02-14extern mod => extern crateAlex Crichton-1/+1
This was previously implemented, and it just needed a snapshot to go through
2014-02-13Removed num::OrderableMichael Darakananda-65/+10
2014-02-13Remove a source of O(n^2) running time in bigints.Felix S. Klock II-2/+14
::num::bigint, Remove a source of O(n^2) running time in `fn shr_bits`. I'll cut to the chase: On my laptop, this brings the running time on `pidigits 2000` (from src/test/bench/shootout-pidigits.rs) from this: ``` % time ./pidigits 2000 > /dev/null real 0m7.695s user 0m7.690s sys 0m0.005s ``` to this: ``` % time ./pidigits 2000 > /dev/null real 0m0.322s user 0m0.318s sys 0m0.004s ``` The previous code was building up a vector by repeatedly making a fresh copy for each element that was unshifted onto the front, yielding quadratic running time. This fixes that by building up the vector in reverse order (pushing elements onto the end) and then reversing it. (Another option would be to build up a zero-initialized vector of the desired length and then installing all of the shifted result elements into their target index, but this was easier to hack up quickly, and yields the desired asymptotic improvement. I have been thinking of adding a `vec::from_fn_rev` to handle this case, maybe I will try that this weekend.)
2014-02-11Factoring bigint, rational, and complex out of libextra into libnum.Felix S. Klock II-0/+3704
Removed use of globs present in earlier versions of modules. Fix tutorial.md to reflect `extra::rational` ==> `num::rational`.