gives the total number of indivisible subexpressions in expr.
- 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.
Examplesopen allclose all
Properties & Relations (2)
Possible Issues (5)
This shows the expression tree whose leaves are counted by LeafCount:
Wolfram Research (1988), LeafCount, Wolfram Language function, https://reference.wolfram.com/language/ref/LeafCount.html.
Wolfram Language. 1988. "LeafCount." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LeafCount.html.
Wolfram Language. (1988). LeafCount. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LeafCount.html