lua-users home
lua-l archive

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


The present specification says math.min(x,...) and math.max(x,...), so
that there must be at least one argument, which must be a number.

There are two ways of having a more general construction.

1. If the argument list always has a first element, there is no reason to
stay with numbers. Anything for which less-than is defined can work.

2. If the arguments are constrained to be numbers, there is no reason
to insist on having at least one argument. math.min over an empty list
is math.huge, math.max over an empty list is -math.huge.