lua-users home
lua-l archive

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


On Thu, Aug 09, 2007 at 09:41:41AM -0300, Roberto Ierusalimschy wrote:
> > Instead, it passes everything AFTER the "-" and then does the
> > unary minus as defined for the default arithmetic type.
> 
> Most languages do this.

For example the C language itself has no support for negative integer
constants.  When you say "-1" it's really a constant expression
involving unary negation of an integer constant.  This has an
interesting corner case when you want to specify the minimal value for
a signed integer type, because in most implementations the negative
range is larger than the positive range and the implementation's
header files have to play tricks like this:

#define LLONG_MIN (-LLONG_MAX - 1LL)

                                                  -Dave Dodge