From: Jim Freeze Date: 2001-11-21T22:37:33+09:00 Subject: [ruby-talk:26011] Re: positive > > something like > > 10.pos -> 10 > > -10.pos -> 0 > > > is this ok? > ( x + x.abs ) / 2 > I like the above, but could be computational expensive (ie, slow). You could also try: x > 0 ? x : 0 ========================================================= Jim Freeze jim@freeze.org --------------------------------------------------------- Today is a fine day for Ruby programming. http://www.freeze.org =========================================================