This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# Gather

 Gather[list]gathers the elements of list into sublists of identical elements. Gatherapplies test to pairs of elements to determine if they should be considered identical.
• The default function used to test whether elements are identical is SameQ.
• Gather will gather together elements for which returns True.
Gather multiple solutions together:
Gather elements that have equal integer parts:
Gather integers that have identical remainders:
Gather polynomials that have identical remainders:
Check the remainders in each list:
Gather multiple solutions together:
 Out[1]=

Gather elements that have equal integer parts:
 Out[1]=

Gather integers that have identical remainders:
 Out[1]=

Gather polynomials that have identical remainders:
 Out[1]=
 Out[2]=
Check the remainders in each list:
 Out[3]=
DeleteDuplicates[list] is equivalent to Gather[list][[All, 1]]:
For a large list, DeleteDuplicates is much faster:
GatherBy is equivalent to Gather:
Gather the rows by Norm and display with the common norm of each group:
Compare to the result of Gather:
When the test cannot be identified as a equality comparison, Gather may be much slower:
The results are identical:
New in 7