and shall be treated as a short-term capital loss in each such taxable year. The entire amount of the net capital loss for any taxable year shall be carried to the earliest of the taxable years to which such loss may be carried, and the portion of such loss which shall be carried to each of the other taxable years to which such loss may be carried shall be the excess, if any, of such loss over the total of the capital gain net income for each of the prior taxable years to which such loss may be carried. For purposes of the preceding sentence, the capital gain net income for any such prior taxable year shall be computed without regard to the net capital loss for the loss year or for any taxable year thereafter. In the case of any net capital loss which cannot be carried back in full to a preceding taxable year by reason of clause (ii) of subparagraph (A), the capital gain net income for such prior taxable year shall in no case be treated as greater than the amount of such loss which can be carried back to such preceding taxable year upon the application of such clause (ii).
For purposes of the preceding sentence, any excess of the deductions allowed for the taxable year over the gross income for such year shall be taken into account as negative taxable income.