about summary refs log tree commit diff
path: root/src/libcore/num/uint-template.rs
AgeCommit message (Collapse)AuthorLines
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-641/+0
This only changes the directory names; it does not change the "real" metadata names.
2013-05-19Register snapshotsBrian Anderson-29/+0
2013-05-18Use cond! macro where appropriateBrendan Zabarauskas-0/+12
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-5/+5
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-10core: Use the new `for` protocolAlex Crichton-8/+34
2013-05-08Remove #[cfg(notest)] and use #[cfg(not(test))] to cooincide with #[cfg(debug)]Zack Corr-14/+14
2013-05-04Register snapshotsBrian Anderson-6/+1
2013-05-02libcore: Export core::from_str::FromStr from core::preludegifnksm-1/+0
2013-05-01Revert rename of Div to QuotBrendan Zabarauskas-17/+12
2013-04-29Rename 'divisible_by' method to 'is_multiple_of', add tests for 'is_odd' and ↵Brendan Zabarauskas-2/+27
'is_even'
2013-04-27Add Orderable traitBrendan Zabarauskas-0/+29
This is a temporary trait until we have default methods. We don't want to encumber all implementors of Ord by requiring them to implement these functions, but at the same time we want to be able to take advantage of the speed of the specific numeric functions (like the `fmin` and `fmax` intrinsics).
2013-04-26Combine PrimitiveInt, Int, and Uint traits into one single traitBrendan Zabarauskas-3/+1
Having three traits for primitive ints/uints seemed rather excessive. If users wish to specify between them they can simply combine Int with either the Signed and Unsigned traits. For example: fn foo<T: Int + Signed>() { … }
2013-04-26Add BitCount traitBrendan Zabarauskas-1/+6
2013-04-26Add Int, Uint and Float traits for primitive numbersBrendan Zabarauskas-0/+2
2013-04-26Add Bitwise, Bounded, Primitive, and PrimitiveInt traitsBrendan Zabarauskas-0/+18
2013-04-26Use `///` doc-comment form instead of `/** */`Brendan Zabarauskas-4/+3
2013-04-26Add is_zero method to ZeroBrendan Zabarauskas-3/+6
2013-04-25Use borrowed pointers for Integer methodsBrendan Zabarauskas-23/+23
This brings them in line with the quot and rem traits, and is be better for large Integer types like BigInt and BigUint because they don't need to be copied unnecessarily.
2013-04-25Rename Natural to IntegerBrendan Zabarauskas-1/+1
'Natural' normally means 'positive integer' in mathematics. It is therefore strange to implement it on signed integer types. 'Integer' is probably a better choice.
2013-04-25Use #[cfg(not(stage0))] to exclude items from stage0Brendan Zabarauskas-8/+2
As requested on the mailing list: https://mail.mozilla.org/pipermail/rust-dev/2013-April/003713.html
2013-04-25Move impls of `Num` out of core::num and clean up importsBrendan Zabarauskas-4/+7
2013-04-24Implement Natural traitBrendan Zabarauskas-0/+72
This adds the following methods to ints and uints: - div - modulo - div_mod - quot_rem - gcd - lcm - divisible_by - is_even - is_odd I have not implemented Natural for BigInt and BigUInt because they're a little over my head.
2013-04-24Implement Signed and Unsigned traits and remove related predicate functionsBrendan Zabarauskas-9/+3
2013-04-23inline the primitive numeric operationsDaniel Micay-0/+18
2013-04-22Rename Div operator trait to Quot and Modulo operator trait to RemBrendan Zabarauskas-22/+28
2013-04-19librustc: WIP patch for using the return value.Patrick Walton-1/+1
2013-04-19Use assert_eq! instead of assert! and remove extraneous parenthesesBrendan Zabarauskas-50/+48
2013-04-18Add #[inline(always)] to each operator methodBrendan Zabarauskas-0/+13
2013-04-18Implement bitwise operator traits for ints and uintsBrendan Zabarauskas-0/+35
2013-04-16libcore,std,syntax,rustc: move tests into `mod tests`, make them private (no ↵Huon Wilson-155/+161
pub mod or pub fn).
2013-04-14Consolidate tests of numeric operationsBrendan Zabarauskas-12/+0
2013-04-09auto merge of #5769 : gifnksm/rust/range_step, r=bstriebors-6/+25
`uint::range_step` or `int::range_step` causes overflow or underflow as following. code: ```rust fn main() { for uint::range_step(3, 0, -2) |n| { println(fmt!("%u", n)); } } ``` output: ``` 3 1 18446744073709551615 18446744073709551613 ... ``` This commit fixes this behavior as follows. ``` 3 1 ```
2013-04-08libcore: from_str_common: provide option to ignore underscores.Huon Wilson-3/+3
Implement the possible improvement listed in the comment on from_str_bytes_common.
2013-04-07libcore: fix overflow/underflow in range_stepgifnksm-6/+25
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-53/+53
2013-03-28Removing unused importsAlex Crichton-1/+1
2013-03-22librustc: Remove the `const` declaration form everywherePatrick Walton-4/+4
2013-03-22libcore: Remove `pure` from libcore. rs=depurePatrick Walton-43/+43
2013-03-22librustc: Remove all uses of `static` from functions. rs=destaticPatrick Walton-4/+4
2013-03-11libsyntax: Stop parsing bare functions in preparation for switching them overPatrick Walton-1/+4
2013-03-11librustc: Replace all uses of `fn()` with `&fn()`. rs=defunPatrick Walton-4/+4
2013-03-07test: Fix tests.Patrick Walton-2/+4
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-56/+56
2013-03-04Adding missing imports for tests, and gate off othersAlex Crichton-1/+2
2013-03-04Remove unused imports throughout src/Alex Crichton-9/+0
2013-02-26Removed deprecated `str()` functions in int-template.rs and uint-template.rsMarvin Löbel-5/+0
2013-02-15Removed generic infinity, NaN and negative zero functionsMarvin Löbel-12/+0
Removed Round impl for integers
2013-02-15Made num <-> str conversion functions use NumStrConv traitMarvin Löbel-3/+3
Removed hacky dependency on Round trait and generic infinity functions Removed generic-runtime-failure-depending-on-type behavior
2013-02-15Moved numeric string conversion functions into own moduleMarvin Löbel-12/+13
2013-02-14librustc: Replace `impl Type : Trait` with `impl Trait for Type`. ↵Patrick Walton-9/+9
rs=implflipping