Number of terms in a freealg object; number of coefficients

nterms(x)

Arguments

x

Freealg object

Value

Returns a non-negative integer

Author

Robin K. S. Hankin

Examples

(a <- freealg(list(1:3,4:7,1:10),1:3))
#> free algebra element algebraically equal to
#> + abc + 3abcdefghij + 2defg
nterms(a)
#> [1] 3
nterms(a+1)
#> [1] 4
nterms(a*0)
#> [1] 0