Skip to content

Commit

Permalink
Merge pull request #3469 from WalterBright/biguintcorebetter
Browse files Browse the repository at this point in the history
std.internal.math.biguintcore: minor improvements
  • Loading branch information
burner committed Jul 3, 2015
2 parents 2b15752 + feb88b8 commit 67a08f1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions std/internal/math/biguintcore.d
Expand Up @@ -53,13 +53,12 @@ public import std.ascii : LetterCase;
shared static this()
{
CACHELIMIT = core.cpuid.datacache[0].size*1024/2;
FASTDIVLIMIT = 100;
}

private:
// Limits for when to switch between algorithms.
immutable size_t CACHELIMIT; // Half the size of the data cache.
immutable size_t FASTDIVLIMIT; // crossover to recursive division
enum size_t FASTDIVLIMIT = 100; // crossover to recursive division


// These constants are used by shift operations
Expand Down Expand Up @@ -2220,7 +2219,7 @@ int firstNonZeroDigit(const BigDigit [] x) pure nothrow @nogc @safe
}
return k;
}
import core.stdc.stdio;

/*
Calculate quotient and remainder of u / v using fast recursive division.
v must be normalised, and must be at least half as long as u.
Expand Down Expand Up @@ -2388,13 +2387,10 @@ pure nothrow
delete scratch;
}

version(unittest)
unittest
{
import core.stdc.stdio;
}

unittest
{
void printBiguint(const uint [] data)
{
char [] buff = biguintToHex(new char[data.length*9], data, '_');
Expand Down

0 comments on commit 67a08f1

Please sign in to comment.