length - Maple Programming Help

length

length of an object

 Calling Sequence length(expr)

Parameters

 expr - expression

Description

 • The length(expr) function returns the length of expr.
 • If expr is an integer, the number of decimal digits is returned (where the length of zero is defined to be zero and the length of a negative integer is defined to be the same as the length of the absolute value of the integer).
 • If expr is a string, the number of characters in expr is returned.
 • If expr is a rtable object, the number of words of storage occupied by the rtable is returned (including the data, the attributes, and the data structure itself).
 • For other objects, the length of each operand of expr is computed recursively and added to the number of words used to represent expr. In this way, the measure of the size of expr is returned.
 • To find the number of elements of a list, set, or Array, use the numelems command.

 • The length command is thread-safe as of Maple 15.

Examples

 > $\mathrm{length}\left(0\right)$
 ${0}$ (1)
 > $\mathrm{length}\left(11\right)$
 ${2}$ (2)
 > $\mathrm{length}\left(14.5\right)$
 ${7}$ (3)
 > $\mathrm{length}\left(\mathrm{abc}\right)$
 ${3}$ (4)
 > $\mathrm{length}\left(x+2y\right)$
 ${9}$ (5)