How to find a min/max with Ruby

Viewed 306873

I want to use min(5,10), or Math.max(4,7). Are there functions to this effect in Ruby?

6 Answers
def find_largest_num(nums)
  nums.sort[-1]
end
Related