lua-users home
lua-l archive

Re: Min and Max

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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.

AltStyle によって変換されたページ (->オリジナル) /