about summary refs log tree commit diff
path: root/src/libstd/num/bigint.rs
AgeCommit message (Collapse)AuthorLines
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-2021/+0
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-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
2013-05-09remove vecs_implicitly_copyable from libstd/libcoreDaniel Micay-1/+0
2013-05-07Add abs_sub method to Signed traitBrendan Zabarauskas-0/+14
2013-05-03add gitattributes and fix whitespace issuesDaniel Micay-1/+0
2013-05-02libcore: Export core::from_str::FromStr from core::preludegifnksm-3/+2
2013-05-02libstd: impl Clone for BigUint/BigInt and replace `copy` with `.clone()`gifnksm-11/+13
2013-05-01Revert rename of Div to QuotBrendan Zabarauskas-63/+60
2013-04-29auto merge of #6108 : gifnksm/rust/bigint-shift-bug, r=brsonbors-21/+39
`std::bigint` contains the following code. ```rust borrow = *elem << (uint::bits - n_bits); ``` The code above contains a bug that the value of the right operand of the shift operator exceeds the size of the left operand, because sizeof(*elem) == 32, and 0 <= n_bits < 32 in 64bit architecture. If `--opt-level` option is not given to rustc, the code above runs as if the right operand is `(uint::bits - n_bits) % 32`, but if --opt-level is given, `borrow` is always zero. I wonder why this bug is not catched in the libstd's testsuite (I try the `rustc --test --opt-level=2 bigint.rs` before fixing the bug, but the unittest passes normally.) This pull request also removes the implicit vector copies in `bigint.rs`.
2013-04-29Rename 'divisible_by' method to 'is_multiple_of', add tests for 'is_odd' and ↵Brendan Zabarauskas-2/+2
'is_even'
2013-04-29libstd: modify wrong shift width.gifnksm-1/+2
borrow = *elem << (uint::bits - n_bits); The code above contains a bug that the value of the right operand of the shift operator exceeds the size of the left operand, because sizeof(*elem) == 32, and 0 <= n_bits < 32 in 64bit architecture. If `--opt-level` option is not given to rustc, the code above runs as if the right operand is `(uint::bits - n_bits) % 32`, but if --opt-level is given, `borrow` is always zero. I wonder why this bug is not catched in the libstd's testsuite (I try the `rustc --test --opt-level=2 bigint.rs` before fixing the bug, but the unittest passes normally.)
2013-04-29libstd: remove implicit copying of BigInt/BigUintgifnksm-20/+37
2013-04-28libstd: inlining almost every methods in bigint module.gifnksm-1/+86
2013-04-28libstd: impl Integer for BigUint/BigInt.gifnksm-143/+297
Also remove abs() method from the non-trait impl for BigInt/BigUint. That method is provided in the Signed trait.
2013-04-26Add is_zero method to ZeroBrendan Zabarauskas-19/+17
2013-04-24Implement Signed and Unsigned traits and remove related predicate functionsBrendan Zabarauskas-8/+25
2013-04-23libstd: correct bigint's quot/rem, div/modulogifnksm-56/+57
2013-04-22Rename Div operator trait to Quot and Modulo operator trait to RemBrendan Zabarauskas-32/+32
2013-04-08Removing no longer needed unsafe blocksAlex Crichton-1/+1
2013-04-07Impl cmp/num traits for BigUint, BigIntgifnksm-145/+187
TotalEq, TotalOrd, FromStrRadix, ToStrRadix.
2013-04-05libstd: move bigint to dedicated num directoryHuon Wilson-0/+1647