net investment income

(2) Net investment income For purposes of this subsection, the term “net investment income” means the excess of— (A) the gross amount of income from interest, dividends, rents, and royalties, plus the excess (if any) of gains from the sale or exchange of assets over the losses from the sale or exchange of assets, over (B) the deductions allowed by this chapter which are directly connected with the production of the income referred to in subparagraph (A). For purposes of the preceding sentence, there shall not be taken into account items taken into account for purposes of the tax imposed by section 511 (relating to tax on unrelated business income).

Source

26 USC § 527(f)(2)


Scoping language

For purposes of this subsection
Is this correct? or