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
>

Blame it on FORTRAN ;-) A lot of what we do was spawned by the design
choices there, in turned spawned by the architecture of the IBM 704.
Scientists were lazy; they wanted coercion of integers to reals,
didn't want to type out leading or trailing zeroes, etc. We're lucky
we don't still have to specify the type of a numeric variable by the
first character of its name! ;-)



-- 
Twitter: http://twitter.com/znmeb; Computational Journalism Publishers
Workbench: http://j.mp/QCsXOr

How the Hell can the lion sleep with all those people singing "A weem
oh way!" at the top of their lungs?