From: Sam Kong Date: 2006-08-08T18:48:28+09:00 Subject: Re: min, max for Fixnum? Hi Ronald, Ronald Fischer wrote: > Did I understand it right that there are no operators/functions > predefined in Ruby for getting the minimum and maximum for two Fixnum? > > I.e. > > def min(a,b) > a < b ? a : b > end > > Or did I just overlook something? > > Ronald I think that min and max are very general, so they don't have to be limited to Fixnum. How about [a, b].min or [a, b].max? [1, 2].min #=> 1 Sam -- Posted via http://www.ruby-forum.com/.