Dylan Knutson
a9552611af
more operators nothrow
2014-05-28 11:57:22 -07:00
Dylan Knutson
ace6a6076d
Make BigInt nothrow where possible
2014-05-27 23:29:52 -07:00
Andrei Alexandrescu
20833c3b94
Merge pull request #1962 from gittywithexcitement/master
...
Add unittests: compare BigUint(0) to 0UL
2014-03-14 01:45:48 -07:00
gittywithexcitement
30999e7dc1
Add unittests: compare BigUint(0) to 0UL
...
to prevent regression of bug 12234.
2014-02-23 16:27:38 -08:00
k-hara
b391b2ec9f
Convert to new alias syntax
2014-02-11 15:27:05 +09:00
monarchdodra
44fe3d88f7
Remove tabs
2014-01-08 08:37:52 +01:00
monarchdodra
fd8540072d
Remove trailing white
2014-01-08 08:30:28 +01:00
Simen Kjærås
8412f4d37a
Removed unnecessary allocations in twosComplement call.
2013-12-14 20:08:43 +01:00
Simen Kjærås
92560323dd
Got rid of expensive AddOrSubInt call (and related allocation).
2013-12-14 19:54:18 +01:00
Simen Kjærås
56ab3796ce
Merge branch 'master' of https://github.com/D-Programming-Language/phobos
...
Conflicts:
std/bigint.d
2013-12-05 10:53:12 +01:00
H. S. Teoh
8f132413dd
Fix issue 11583.
...
The problem is that the assumption that the first word of a BigUint is
always non-zero is false when BigUint == biguintcore.ZERO, which is
defined to be [0]. So we need to check for that case in
BigUint.opCmp(ulong).
Also, crash-proof BigUint's invariant, since it would cause an
out-of-bounds array access if a bug causes data.length==0.
2013-12-04 22:28:23 -08:00
H. S. Teoh
1945bcacf8
Fix issue 11600: to!BigInt(string) should validate input.
2013-11-27 18:43:06 -08:00
Simen Kjærås
52fc3fb3e6
Fixed compilation errors on 64-bit platforms (hopefully)
2013-11-27 09:21:01 +01:00
Simen Kjærås
ed5a286826
Removed unnecessary allocation and computation
2013-11-26 17:50:44 +01:00
Simen Kjærås
6aea683103
Fix 8167 (identity constructor) and 9061 (bitwise ops)
2013-11-26 01:41:45 +01:00
monarch dodra
9a93d82e99
Merge pull request #1679 from BioTronic/master
...
BigInt const (Fixes 11148 and parts of 11188)
2013-11-18 01:29:53 -08:00
Daniel Murphy
4806357623
Fixup for issue 11532
2013-11-17 23:16:31 +11:00
unknown
536dd1ceea
More fixes.
2013-11-04 14:46:09 +01:00
unknown
862f8a0ada
Fixed template constraints in biguintcore.
2013-11-04 14:36:32 +01:00
Simen Kjærås
48ca747ddf
Fixed wrong placement of unittest in pull 1679
2013-11-03 03:03:10 +01:00
Simen Kjærås
3cd19ed494
More fixes for pull 1679
2013-11-02 16:08:07 +01:00
Simen Kjærås
0bf6df0cd8
Fix error inpull 1679
2013-11-02 11:09:19 +01:00
Simen Kjærås
8dc07ba85e
BigInt const (Fixes 11148 and parts of 11188)
2013-11-02 02:27:23 +01:00
k-hara
644e11ea46
fix Issue 9665 - Structure constant members can not be initialized if have opAssign
2013-10-14 21:42:26 +09:00
H. S. Teoh
8411eaa6b4
Expand tab.
2013-07-15 07:49:15 -07:00
H. S. Teoh
658a6d648d
Use typeid.getHash instead of rt.util.hash.hashOf which is not
...
accessible from outside druntime.
2013-07-09 07:12:11 -07:00
H. S. Teoh
70d4c03fe2
Fix issues 8435, 10118.
2013-07-09 07:12:11 -07:00
Andrei Alexandrescu
e54288b6b7
Merge pull request #1231 from Safety0ff/master
...
Fix std.BigInt bug #9548 plus other new discovered bugs.
2013-05-25 23:36:32 -07:00
Robert BuRnEr Schadek
cab595ec0f
bigint pure
...
the only exception is toString as it takes a delegate and this makes
things more tricky
2013-05-10 05:23:44 +02:00
Robert BuRnEr Schadek
0bf5632e80
Merge branch 'master' into bigintpure
...
Conflicts:
std/bigint.d
2013-05-09 06:40:26 +02:00
Robert BuRnEr Schadek
a686647f54
bigint purity
2013-05-09 06:24:26 +02:00
safety0ff
202d182152
Fix std.BigInt bug #9548 plus other new discovered bugs.
2013-04-08 23:24:30 -04:00
kai
8f34d9a05e
Fix big endian issue in std.internal.math.biguintcore.d
...
The unit tests passes with this change on Linux/PPC64.
2013-04-07 14:55:29 +02:00
safety0ff
835fca54e9
BigInt enhancement: make std.math.abs work with BigInt (issue 6486)
2013-03-31 18:54:15 -04:00
Walter Bright
e422fb7e9c
fix int overflow
2013-03-26 21:21:24 -07:00
alexrp
b202180295
Remove all uses of sizediff_t in favor of ptrdiff_t.
2012-10-15 04:24:09 +02:00
Don Clugston
15c655f1b5
Fix issue 8164 BigInt from char[] too
2012-06-22 07:05:06 +02:00
Don Clugston
a79bb20ea7
Fix issue 7993 BigInt divide-by-1 error
...
Thanks to c.m.brandeburg for the fix.
2012-06-21 18:36:22 +02:00
Brad Roberts
3980990974
fix 32 vs 64bit-ism in bituintcore.d
2011-11-26 14:42:31 -08:00
Don Clugston
1b6bb96de7
Add more comments for Biguint.pow
...
The memory usage calculation was complicated and deserved more explanation.
I've also rewritten it in a way which is clearer.
2011-10-20 15:13:50 +02:00
Don Clugston
c0b25d0903
6819 BigInt ^^ fails for some big numbers (powers)
...
I've also greatly improved the comments for pow.
2011-10-18 15:00:24 +02:00
k-hara
c5c1c0dbbf
detab/entab
2011-09-02 20:56:40 +09:00
jmdavis
302323559a
Revert "not really pure"
...
This reverts commit 4f28db6ffb
.
Since Walter put weakly pure back in, these changes need to be undone.
Conflicts:
std/datetime.d
2011-07-07 01:40:07 -07:00
Walter Bright
4f28db6ffb
not really pure
2011-06-25 19:58:09 -07:00
Don Clugston
134d9e14a9
5285 bigint won't compile in 64 bit
2011-04-30 04:57:52 +08:00
Don Clugston
0d8d3d5229
Remove assignment of immutable to mutable
...
This compiles with the current DMD, but should generate an error.
2011-04-15 07:29:12 +08:00
Don Clugston
ab1b7d621a
5654 BigInt returns ZERO with strings of single digit number with leading zeros
...
A straightforward bug.
2011-03-26 15:20:14 -07:00
donc
69d8b2e514
Fix Bigint unittest failure
...
Ensure the new, harsher function preconditions for recursiveDivMod are
satisfied when called from blockDivMod.
2011-02-25 00:08:59 +08:00
Don Clugston
9ecf947290
5568 A problem with BigInt modulus
...
This is quite subtle. The recursive division algorithm has a possibility of one
bit of overflow in the second recursive call, in cases where the top quarter of
the dividend is identical to the top half of the divisor.
The description of the recursive division algorithm in "Modern Computer
Arithmetic" 0.5.9 is rather vague about this (which is why I missed it
originally, though the test case does cause assert failure in biguint).
Unfortunately it requires fairly substantial changes to the function, which
makes the algorithm a lot less elegant. But I have managed to implement it
without any change to the basic division algorithm (which is very fast).
2011-02-23 21:20:48 +01:00
Don Clugston
dd4f4a1827
Fix code indentation for biguintcore
...
This commit changes code formatting only. No changes to code.
2011-02-18 22:15:35 +01:00