summary refs log tree commit diff
path: root/src/libextra/num/bigint.rs
AgeCommit message (Collapse)AuthorLines
2014-01-07extratest: Fix all leaked trait importsAlex Crichton-0/+2
2014-01-08Renamed Option::map_default and mutate_default to map_or and mutate_or_setMarvin Löbel-1/+1
2013-12-08Remove dead codesKiet Tran-1/+0
2013-11-26test: Remove all remaining non-procedure uses of `do`.Patrick Walton-4/+12
2013-11-26librustuv: Remove all non-`proc` uses of `do` from `libextra` andPatrick Walton-37/+38
`librustuv`.
2013-11-17extra: handle an edge case in BigUint.to_str().Huon Wilson-1/+6
If any of the digits was one past the maximum (e.g. 10**9 for base 10), then this wasn't detected correctly and so the length of the digit was one more than expected, causing a very large allocation. Fixes #10522. Fixes #10288.
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-9/+9
Who doesn't like a massive renaming?
2013-10-09option: rewrite the API to use compositionDaniel Micay-3/+3
2013-10-05extra: fix BigInt on 32bit machinesErick Tryzelaar-127/+139
2013-10-05extra: Don't truncate {u64,i64} when converting to BigIntsErick Tryzelaar-19/+121
2013-10-02extra: Add ToBigInt and ToBigUint traitsErick Tryzelaar-0/+90
2013-10-02std: Swap {To,From}Primitive to use the 64bit as the unimplemented versionErick Tryzelaar-24/+24
One downside with this current implementation is that since BigInt's default is now 64 bit, we can convert larger BigInt's to a primitive, however the current implementation on 32 bit architectures does not take advantage of this fact.
2013-10-02std: Replace num::IntConvertible with {To,From}PrimitiveErick Tryzelaar-211/+212
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-1/+1
Closes #9467
2013-09-30extra: Remove usage of fmt!Alex Crichton-9/+9
2013-09-26bigint: backticks for code in documentationkud1ing-35/+35
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-18Remove and replace cond! Closes #9282.Jimmy Zelinskie-2/+2
2013-09-17auto merge of #9133 : dcrewi/rust/bigint-random-range, r=huonwbors-2/+140
2013-09-17Generate random big integers within a rangeDavid Creswick-2/+140
Thanks to @huonw for feedback
2013-09-12std: Add Option.{and,and_then,or,or_else}Erick Tryzelaar-2/+2
2013-09-11auto merge of #9014 : dcrewi/rust/convert-between-bigints, r=anasazibors-42/+130
2013-09-11auto merge of #9007 : dcrewi/rust/random-bigints, r=huonwbors-0/+64
2013-09-09auto merge of #9083 : dcrewi/rust/biguint-bit-ops, r=brsonbors-0/+79
2013-09-09Implement bitwise operations on BigUintDavid Creswick-0/+79
2013-09-09Merge RandBigUint and RandBigInt into single traitDavid Creswick-21/+17
2013-09-09Convert between BigInts, BigUints, ints, and uintsDavid Creswick-53/+100
Previously, conversion to ints, uints, and BigUints clamped the value within the range of that datatype. With this commit, conversion overflows fail the task. To handle overflows gracefully, use the new to_*_opt() methods.
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-2/+2
The trait will keep the `Iterator` naming, but a more concise module name makes using the free functions less verbose. The module will define iterables in addition to iterators, as it deals with iteration in general.
2013-09-06Incorporate feedback from huonwDavid Creswick-7/+22
- use identifiers with underscores to avoid unused variable warning - implement on R: Rng instead of on R: RngUtil - bugfix: zero BigInts were being generated twice as often as any other number - test that gen_biguint(0) always returns zero
2013-09-05Convert between BigInts and BigUintsDavid Creswick-0/+41
2013-09-05test the correct function (oops)David Creswick-2/+2
2013-09-05Generate random BigUints and BigIntsDavid Creswick-0/+53
2013-08-30std: Implement .rposition() on double-ended iterators with known sizeblake2-ppc-1/+1
This is a generalization of the vector .rposition() method, to all double-ended iterators that have the ExactSizeHint trait. This resolves the slight asymmetry around `position` and `rposition` * position from front is `vec.iter().position()` * position from the back was, `vec.rposition()` is now `vec.iter().rposition()` Additionally, other indexed sequences (only `extra::ringbuf` I think), will have the same method available once it implements ExactSizeHint.
2013-08-27librustc: Fix merge falloutPatrick Walton-7/+8
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-19/+42
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-26bigint: fix wrong benchmark fn namegifnksm-1/+1
2013-08-26bigint: Add benchmarksgifnksm-0/+44
2013-08-25bigint: un-ignore test_shrgifnksm-73/+68
2013-08-25bigint: inlining small functionsgifnksm-97/+92
2013-08-25bigint: remove unnecessary method implementsgifnksm-42/+0
2013-08-25bigint: cfg(target_arch = ...) => cfg(target_word_size = ...)gifnksm-25/+11
2013-08-20rm obsolete integer to_str{,_radix} free functionsDaniel Micay-1/+1
2013-08-12Forbid pub/priv where it has no effectAlex Crichton-1/+1
Closes #5495
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-2/+2
cc #5898
2013-08-07Forbid `priv` where it has no effectAlex Crichton-10/+10
This is everywhere except struct fields and enum variants.
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-2/+2
2013-08-07std: add result.map_move, result.map_err_moveErick Tryzelaar-1/+1
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-6/+6
- 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-08-03remove obsolete `foreach` keywordDaniel Micay-28/+28
this has been replaced by `for`
2013-08-02replace `range` with an external iteratorDaniel Micay-1/+1