numbers
Extracts all numbers from an object.
Syntax
-
numbers(X)
-
X
is any object
-
Description
If X
is any object, then numbers(X)
returns the list containing all numbers that are found in X
at any level.
Examples
numbers(RandomMatrix(3))
0.891793747665 0.369915822987 0.78457142855 0.139452554286 0.378758438164 0.4342129617 0.928230240708 0.342635645531 0.689236234175
L ≔ '(1, 2, "dog", '(5, 2), '('(10, 52, 22, "cat", RandomMatrix(2)), π))
1 2 dog (5, 2) ((10, 52, 22, cat, ((0.0958684554789, 0.0282259541564), (0.91912535741, 0.293840126134))), 3.14159265359)
numbers(L)
1 2 5 2 10 52 22 0.0958684554789 0.0282259541564 0.91912535741 0.293840126134 3.14159265359