- BigInteger f = easyStringToBI(s);
- // Ah. The string is converted to a BigInteger, and strings can be as long as you want.
-
- std::string s2 = easyBItoString(f); // You can convert the other way too.
-
- std::cout << f << std::endl; // f is stringified and send to std::cout.
-
- /*
- * Let's do some math!
- *
- * The Big Integer Library provides three kinds of operators:
- *
- * (1) Overloaded ``value'' operators: +, -, *, /, %, unary -.
- * Big-integer code using these operators looks identical to
- * code using the primitive integer types. The operator takes
- * one or two BigInteger inputs and returns a BigInteger result,
- * which can then be assigned to a BigInteger variable or used
- * in an expression.
- *
- * (2) Overloaded assignment operators: +=, -=, *=, /=, %=,
- * ++, --, flipSign.
- * Again, these are used on BigIntegers just like on ints.
- * They take one writable BigInteger that both provides an
- * operand and receives a result. The first five also take
- * a second read-only operand.
- *
- * (3) ``Put-here'' operations: `add', `subtract', etc.
- * Use these if and only if you are concerned about performance.
- * They require fewer BigInteger copy-constructions and assignments
- * than do operators in (1) or (2). Most take two read-only operands
- * and save the result in the invoked object `*this', whose previous
- * value is irrelevant. `divideWithRemainder' is an exception.
- * <<< NOTE >>>: Put-here operations do not return a value: they don't need to!!
- */
-
+ BigInteger f = stringToBigInteger(s);
+
+ // You can convert the other way too.
+ std::string s2 = bigIntegerToString(f);
+
+ // f is implicitly stringified and sent to std::cout.
+ std::cout << f << std::endl;
+
+ /* Let's do some math! The library overloads most of the
+ * mathematical operators (including assignment operators) to
+ * work on BigIntegers. There are also ``copy-less''
+ * operations; see `BigUnsigned.hh' for details. */
+
+ // Arithmetic operators