This preferential status allows hotchpot gains and losses to be treated as long-term capital gains and losses when the gains " are greater than " the losses ( thereby treating the net gain at a more favorable tax rate ), and allows them to be treated as ordinary income and ordinary losses when the gains are " less than or equal to " the losses ( thereby allowing the losses to cancel out the income ) ( Id . at 522 . ) Under the code, long-term capital gains are gains from the sale or exchange of a capital asset held for more than one year, if and to the extent that such gain is considered when computing gross income.