LeafCount

LeafCount[expr]
gives the total number of indivisible subexpressions in expr.

DetailsDetails

  • LeafCount gives a measure of the total "size" of an expression.
  • LeafCount counts the number of subexpressions in expr that correspond to "leaves" on the expression tree.
  • LeafCount is based on FullForm representation of expressions.
  • Numbers with heads Rational and Complex are treated as composite objects, just as in FullForm.
New in 1
New to Mathematica? Find your learning path »
Have a question? Ask support »