-// CONSTRUCTION FROM PRIMITIVE INTEGERS
-
-/* Initialize this BigUnsigned from the given primitive integer. The same
- * pattern works for all primitive integer types, so I put it into a template to
- * reduce code duplication. (Don't worry: this is protected and we instantiate
- * it only with primitive integer types.) Type X could be signed, but x is
- * known to be nonnegative. */
-template <class X>
-void BigUnsigned::initFromPrimitive(X x) {
- if (x == 0)
- ; // NumberlikeArray already initialized us to zero.
- else {
- // Create a single block. blk is NULL; no need to delete it.
- cap = 1;
- blk = new Blk[1];
- len = 1;
- blk[0] = Blk(x);
- }
-}
-
-/* Ditto, but first check that x is nonnegative. I could have put the check in
- * initFromPrimitive and let the compiler optimize it out for unsigned-type
- * instantiations, but I wanted to avoid the warning stupidly issued by g++ for
- * a condition that is constant in *any* instantiation, even if not in all. */
-template <class X>
-void BigUnsigned::initFromSignedPrimitive(X x) {
- if (x < 0)
- throw "BigUnsigned constructor: "
- "Cannot construct a BigUnsigned from a negative number";
- else
- initFromPrimitive(x);
-}