Indefinite precsion integer data type

We require to perform signed arithmetic operations on large integers of indefinite precision. You may therefore design and implement an indefinite precision integer data type (call it myinteger), that supports instances of signed integers of an arbitrary number of decimal digits. It should be possible to perform addition, subtraction, multiplication, integer division and remainder finding, as defined in usual signed integer arithmetic. You may also implement a sign function that returns "false" for a negative integer, and "true" otherwise. We require that minimal space be used to store each integer. In addition, any integer instance not required for further computations may be gracefully freed to return space back to the memory pool. You may use decimal digits in your design for representing integers. Note also that the first five operations mentioned above are binary, taking in two integers and producing a new third integer. The sixth sign operation is unary. A seventh unary operation reversing the sign of an integer may also be implemented. More formally, we must have functions as

(i) myinteger construct (int i); creates a new myinteger with initial value i. (think about it like typecasting from the standard int to myinteger).

(ii) myinteger add (myinteger a, myinteger b); adds a and b returning their sum a+b.

(iii) myinteger subtract (myinteger a, myinteger b); subtracts b from a and returns the signed difference a-b.

(iv) myinteger multiply (myinteger a, myinteger b); multiplies a and b and returns the product ab.

(v) myinteger quotient (myinteger a, myinteger b); returns the quotient q of division of a by b. (q is the largest signed integer so that qb is less than a).

(vi) myinteger remainder (myinteger a, myinteger b); returns the remainder of division of a by b for quotient as defined in (v).

(vii) boolean sign (myinteger a); returns "false" if a is negative, and "true" otherwise.

(viii) myinteger toggle (myinteger a); returns -a.

(ix) destroy (myinteger a); frees the instance a of myinteger.

In addition, you should also have functions to read a myinteger (digit by digit) and print out myinteger.