lua-users home
lua-l archive

Re: [ANN] Lua 5.3.0 (work1) now available

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


2013年7月7日 Luis Carvalho <lexcarvalho@gmail.com>:
>> = isinteger("x")
>>
>> What does this return? I don't have 5.3 handy at the moment.
>
> true, which is wrong; sorry for the noise and thanks for the heads-up! Better
> version:
>
> isinteger = function(x)
> return type(x) == "number" and not math.isfloat(x)
> end
>
Since this is very short, I don't see any objections about integrating
into the Lua core instead of writing it each time :-). Also there is
math.isfloat() why not math.isinteger?
Much cleaner, much convenient
Regards,
--
Demelier David

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