资 源 简 介
Design a class (or a class library) to handle unlimited integer operations (integer larger)
Provide the class standard overloaded arithmetic operators.
Follow the rules "do as ints do".
Write a test for BigInt operations:
Example:
{ BigInt x = 569; // ctor with an integer BigInt y; // default ctor y = pow(x, 10); // 569*569*...*569 ten times (a big number!) BigInt z = x; //copy ctor z = x; // operator= z += y; // operator+, operator+=, -, -=, *, *= z %= y; // operator%, operator/ operator%= z %= 5; // same operators of above... it is better to provide overloads for int or just convert int to BigInt? BigInt w("348734834853836786386736"); // yeah, ctor that takes a string! w++; // postincrement, preincrement if(w <= y) // yeeeah, comparison! <, <=, >, >=, ==, != z &= x; // bitwise and, or, xor... std:: cout << y; // obviously streams operators... x =