lua-users home
lua-l archive

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


In the lua-5.0.3 draft manual (and previous editions), the documentations
for these functions states:

"If isnum is not NULL, its referent is assigned a boolean value that
indicates whether the operation succeeded."

However in the context of the rest of the description "succeeded" is
ambiguous since default behaviours are specified for circumstances that
might or might not be considered "failure". I'm guessing the value not being
a number or a string convertible to a number is definitely "failure" (or
else lua_tonumberx has the same problem). But is not being an integer? For
lua_tounsignedx, is being negative or being too large an integer?

Also, in lua_tounsignedx ( in the 5.0.3 draft ):

"If the number is not an integer, it is rounded towards minus infinite
(floor). If the result is outside the range of representable values, it is
normalized to the module of its division by one more than the maximum
representable value."

Sorry if my math is letting me down, but does this specify what happens if
the value is negative?