[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Min and Max
- From: Rici Lake <lua@...>
- Date: Thu, 25 Aug 2005 12:12:20 -0500
On 25-Aug-05, at 11:39 AM, Roberto Ierusalimschy wrote:
rmin = rmin min value
rmax = rmax max value
If a<=b returned a instead of true, we could write "a<=b or b" for min
and "a>=b or b" for max :)
True enough. As long as no-one thought of defining __lt for booleans
such that false < true :)
This makes reductions a little easier to write,
Lua 5.1 offers the value math.huge, which you can use as the neutral
element for min.
Yes, but that only works for numbers, not (for example) for strings.