[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Floating point numbers locale bug?
- From: Mike Pall <mikelu-0701@...>
- Date: Fri, 26 Jan 2007 10:34:32 +0100
Hi,
Matthew Armstrong wrote:
> When reading a comparison between lua and python:
> http://lua-users.org/wiki/LuaVersusPython
>
> I ran across this item:
> Floating point numbers locale bug. Lua needs some dirty hacks to keep your
> scripts working when using floating point numbers.
Well, that page seems to have grown into a flamefest. Anyway, the
statement is simply untrue. Lua 5.1 deals with this properly:
$ lua
Lua 5.1 Copyright (C) 1994-2006 Lua.org, PUC-Rio
> = 1.2
1.2
> os.setlocale("de_DE@euro", "numeric")
> = 1.2
1,2
I don't think that setting the numeric locale is a good idea in
general. But Lua's parser still works. It has an explicit
workaround for parsing floating-point numbers in non-standard
locales.
Bye,
Mike