rollrat / biginteger Goto Github PK
View Code? Open in Web Editor NEWBigInteger library for 64bit system.
BigInteger library for 64bit system.
bool BigBase::operator<(const this_type& integer) const {
if (length > integer.length)
return false;
else if (length < integer.length)
return true;
else if (length == 0 && integer.length == 0)
return false;
else {
for (int ptr = (int)length; --ptr >= 0;)
if (blocks[ptr] < integer.blocks[ptr]) return true;
else return false;
return false;
}
}
void BigBase::init_decimal(std::string dec) {
size_t len = dec.length();
size_t estimate = len * 4;
allocate(estimate);
memset(blocks, 0, sizeof(uint32_t) * estimate);
size_t count = len % 9;
if (count > 0) {
blocks[0] = to_int9(dec, 0, count);
}
if (len / 9) {
len -= count;
for (uint32_t i = 0; i < len; i += 9) {
uint64_t carry = to_int9(dec, count + i, 9);
carry += (uint64_t)(blocks[0]) * 1000000000;
blocks[0] = (uint32_t)carry;
carry /= 0xFFFFFFFF;
for (int j = 1; carry; j++) {
carry += (uint64_t)(blocks[j]) * 1000000000;
blocks[j] = (uint32_t)carry;
carry /= 0xFFFFFFFF;
}
}
}
trim();
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.