Sam Cappleman-Lynes
1fb03ca18a
Make new code work on rustc-1.8.0
...
- Don't apply attributes to statements (1.12.0)
- Don't use checked_abs (1.13.0)
2017-06-30 00:39:37 +01:00
Sam Cappleman-Lynes
2a3cd41820
Add scalar ops for all remaining integer types
2017-06-29 22:18:54 +01:00
Sam Cappleman-Lynes
99873d06e5
Scalar operations on integer types up to 32 bits
2017-06-29 18:29:14 +01:00
Sam Cappleman-Lynes
94d570697c
Add operations on i32 to BigInt
2017-06-29 17:20:17 +01:00
Sam Cappleman-Lynes
9b0392d235
Add scalar division to BigInt
2017-06-29 16:19:11 +01:00
Sam Cappleman-Lynes
8b1288ea01
Add scalar multiplication to BigInt
2017-06-29 15:46:07 +01:00
Sam Cappleman-Lynes
79448cbdf9
Add scalar subtraction to BigInt
2017-06-29 15:15:59 +01:00
Sam Cappleman-Lynes
80feea2722
Also implement scalar addition for BigInt
2017-06-29 14:07:44 +01:00
Sam Cappleman-Lynes
e520bdad0d
Add scalar multiplication to BigUint, BigInt
...
BigUint and BigInt can now be multiplied by a BigDigit, re-using the same buffer for the output, thereby reducing allocations and copying.
2017-06-28 14:02:45 +01:00
Josh Stone
8964c65f38
bigint: apply a consistent order of conversion methods
2017-06-21 17:52:24 -07:00
Josh Stone
8dd6890ddc
Merge commit 'refs/pull/304/head' of github.com:rust-num/num
2017-06-21 17:33:46 -07:00
Eduardo Pinho
15f9334955
De-generalize `twos_complement' helper function
2017-06-20 01:31:49 +01:00
Eduardo Pinho
61cfdc37b3
BigInt two's complement adjustments
...
- rename `_twos_complement_` methods to just `_signed_`
- make `from_` variants take &[u8]
- refactor helper functions twos_complement (they take byte slice but use a generic function underneath)
- fix issues in `to_signed_` functions (only two's complement negative numbers; perform byte extension where needed)
- add tests to `to_signed_` methods
2017-06-18 01:42:56 +01:00
Phaiax
563e4dc509
from_radix_be/le for BigInt
2017-06-16 23:28:49 +02:00
Eduardo Pinho
1660590125
Add BigInt 2's complement conversions
...
- add methods `from_twos_complement_bytes_le`, `from_twos_complement_bytes_be`, `to_twos_complement_bytes_le`, and `to_twos_complement_bytes_be` to `BigInt`.
- add respective tests
2017-06-16 17:58:04 +01:00
Phaiax
1ea02d8d0c
Add _be/_le postfix to from/to_radix functions (BigInt)
2017-06-13 15:36:59 +02:00
Phaiax
fc09503d3d
Add fn from_radix() for radix > 36.
2017-06-11 20:08:43 +02:00
Phaiax
1ab07df709
Add fn to_radix() for radix > 36.
2017-06-11 18:31:44 +02:00
Josh Stone
4b8c71fbec
bigint: Cleanup unused imports
2017-03-06 13:20:30 -08:00
Josh Stone
5c3d759d6c
bigint: inline bits() methods
2016-08-10 22:23:28 -07:00
Kent Overstreet
279522316c
bigint: Break out into multiple files
2016-07-18 15:56:03 -08:00