lua-users home
lua-l archive

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


On Mon, Sep 17, 2012 at 12:33 PM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> ...is "3." a valid number? O.o
>
> Sure. That is the whole problem...
>
> print(3. , .5)   --> 3     0.5
> print(3. .. .5)  --> 30.5
>
> (Many current languages accept this format: C, Perl, Python, Lua, Scheme,
> etc.)
>
> -- Roberto
>

Indeed. Not only do many languages ACCEPT this format, it's often
idiomatic to indicate that a number is intended to be a floating-point
value as opposed to an integral one in languages where this matters (C
and Python are the ones that come to mind out of the list here).

/s/ Adam