[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Make sure numbers are numbers
- From: HyperHacker <hyperhacker@...>
- Date: Sun, 18 Apr 2010 22:42:54 -0600
On Sun, Apr 18, 2010 at 22:09, Patrick Donnelly <email@example.com> wrote:
> On Sun, Apr 18, 2010 at 11:51 PM, Pan Shi Zhu <firstname.lastname@example.org> wrote:
>> in C, the lua_tonumber() is an in-place convertion, it changes the
>> value in stack and may cause unwanted behavior when you're iterating a
> This is not true. lua_tonumber and its variants do not change the
> value of the stack location. It converts the value to a number and
> returns that number.
> - Patrick Donnelly
Correct, according to the manual, lua_tolstring (and lua_tostring)
perform in-place conversion of numbers, while lua_tonumber and others
Sent from my toaster.