TakeLargest
[list, f, n]List the largest two numbers of a list:
TakeLargest[{100, -1, 50, 10}, 2]
None, Null, Indeterminate and expressions with head Missing are ignored by default:
TakeLargest[{-8, 150, Missing[abc]}, 2]
You may specify which items are ignored using the option ExcludedForms
:
TakeLargest[{-8, 150, Missing[abc]}, 2, ExcludedForms -> {}]