The following code returns the first three integer elements of Sqrt[Range[100]]
:
Cases[Sqrt[Range[100]], _Integer, 2, 3]
{1, 2, 3}
The following code looks like the preceding code but returns a different result:
Cases[Sqrt[Range[100]], _Integer, {2}, 3]
{2, 3, 5}
As we can see in the following picture, the argument {2}
is not documented (it has no braces in the documentation):
What does the second code with {2}
instead of 2
mean?