about summary refs log tree commit diff
path: root/src/libstd/num
AgeCommit message (Collapse)AuthorLines
2013-07-30Improve std::num module description, and fix some formattingBrendan Zabarauskas-21/+4
2013-07-30Add some missing method wrappers to std::numBrendan Zabarauskas-2/+24
2013-07-24Change 'print(fmt!(...))' to printf!/printfln! in src/lib*Birunthan Mohanathas-1/+1
2013-07-22std: add #[bench] benchmarks for num::strconvGraydon Hoare-0/+24
2013-07-20librustc: Remove `pub extern` and `priv extern` from the language.Patrick Walton-99/+133
Place `pub` or `priv` on individual items instead.
2013-07-20auto merge of #7894 : pcwalton/rust/and-pointers-in-at-boxes, r=brsonbors-2/+2
r? @brson
2013-07-19std: Remove old magic core modBrian Anderson-1/+1
2013-07-18librustc: Forbid `&` pointers (other than `&'static`) inside `@` boxes.Patrick Walton-2/+2
This makes custom borrowing implementations for custom smart pointers sound.
2013-07-17librustc: Remove all uses of the `Copy` bound.Patrick Walton-6/+4
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-9/+10
2013-07-10Switch over to new range_rev semantics; fix #5270.Felix S. Klock II-6/+8
2013-07-10Refactored int/uint range code in preparation for change to range_rev semantics.Felix S. Klock II-33/+148
Also added unit tests of range code to test refactoring. The num-range-rev.rs test will need to be updated when the range_rev semantics change.
2013-07-08 Replaces the free-standing functions in f32, &c.Jens Nockert-263/+81
The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16, u32, u64, float, int, and uint are replaced with generic functions in num instead. If you were previously using any of those functions, just replace them with the corresponding function with the same name in num. Note: If you were using a function that corresponds to an operator, use the operator instead.
2013-07-01rustc: add a lint to enforce uppercase statics.Huon Wilson-7/+17
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-134/+182
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-28librustc: Remove the broken overloaded assign-ops from the language.Patrick Walton-1/+1
They evaluated the receiver twice. They should be added back with `AddAssign`, `SubAssign`, etc., traits.
2013-06-28librustc: Disallow "mut" from distributing over bindings.Patrick Walton-2/+4
This is the backwards-incompatible part of per-binding-site "mut".
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-578/+578
2013-06-16Add copies to type params with Copy boundNiko Matsakis-17/+17
2013-06-14Add Zero impls for lots of common typesAlex Crichton-0/+15
2013-06-12std: unify the str -> [u8] functions as 3 methods: .as_bytes() and ↵Huon Wilson-37/+38
.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-06-11std: convert pow, hypot, atan2, log to take arguments by reference.Huon Wilson-20/+20
2013-06-08std: Fix search-and-replace typosTim Chevalier-1/+1
2013-06-04librustc: Disallow multiple patterns from appearing in a "let" declaration.Patrick Walton-2/+2
You can still initialize multiple variables at once with "let (x, y) = (1, 2)".
2013-05-30Add example for uint::range_step.Steve Klabnik-3/+12
2013-05-30Require documentation by default for libstdAlex Crichton-0/+35
Adds documentation for various things that I understand. Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-4/+35
2013-05-29Changed to a more efficient implementation.Matthijs Hofstra-16/+4
2013-05-29Replaced calls to external fmin/fmax by a Rust implementation.Matthijs Hofstra-4/+31
2013-05-28Silence various warnings throughout test modulesAlex Crichton-80/+80
2013-05-28auto merge of #6771 : thestinger/rust/highlight, r=luqmanabors-3/+3
This works with pandoc linked against highlighting-kate >= 0.5.3.8. It seems to just be a no-op with earlier versions, because I successfully ran this through `try`. This also fixes some consistency issues (like making `Example`/`Examples` always a header and always using three tildes).
2013-05-27syntax highlight code examples in docstringsDaniel Micay-3/+3
2013-05-27Get rid of no-longer-needed #[doc(hidden)] attributes.Lindsey Kuper-2/+0
There were several old `#[doc(hidden)]` attributes in libstd and libextra, left over from when rustdoc didn't hide private definitions, tagged with `FIXME #3538`. Since #3538 is now closed, I removed the `#[doc(hidden)]` attributes as well as the FIXMEs, but I left `#[doc(hidden)]` in libstd/task/spawn.rs and libstd/task/rt.rs since those two are apparently `pub`, as well as in libextra/std.rc since std/extra is `pub`.
2013-05-24Remove usage of the #[merge] hack with int modulesAlex Crichton-1121/+923
2013-05-23cleanup warnings from libstdErick Tryzelaar-152/+150
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-2861/+7635
This only changes the directory names; it does not change the "real" metadata names.
2013-05-19Use assert_eq! rather than assert! where possibleCorey Richardson-22/+22
2013-05-14auto merge of #6471 : gifnksm/rust/reform-rational, r=brsonbors-84/+126
`std::ratio` module contains `BigRational` type, but the type is not usable by following reasons. * `Ratio::new` requires `T: Copy + Num + Ord`, but `BigInt` is not implicitly copyable, because it contains unique vector. * `BigInt` is not implements `Num` So, I rewrite `Ratio` as follows. * `Ratio` requires `T: Clone + Integer + Ord`. * `Copy` -> `Clone`: to be able to use `BigRational` * `Num` -> `Integer`: It is incorrect that a rational number constructed by two non-integer numbers. * `BigInt` implements `Num` and `Orderable` which are required by `Integer` bound
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-1/+1
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
2013-05-14libstd: Add tests for BigRationalgifnksm-20/+56
2013-05-14libstd: `Ratio` requires `Clone` instead of `Copy`gifnksm-23/+28
This allows creating `Ratio<T>` which `T` is non-implicitly copyable types such as `BigInt`.
2013-05-14libstd: `Rational` requires `Integer` as type bounds instead of `Num`gifnksm-53/+14
2013-05-14libstd: impl `Orderable` for `BigUint`/`BigInt`gifnksm-1/+37
2013-05-14libstd: impl Num for BigUint/BigIntgifnksm-0/+4
2013-05-11auto merge of #6429 : gifnksm/rust/bigint-is_even, r=catamorphismbors-1/+12
`BigUint::is_even()` didn't return correct value.
2013-05-11Warning policeTim Chevalier-2/+0
2013-05-12libstd: Fix BigUint::is_evengifnksm-1/+12
2013-05-10renamed vec::from_slice to vec::to_ownedYoungsoo Son-1/+1