[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Numeric constants and 'D' as an exponent
- From: "Peter Cawley" <lua@...>
- Date: Mon, 3 Nov 2008 19:58:43 +0000
Lua uses the C library function strtod to convert strings to numbers.
Some CRT implementations only permit 'e' and 'E' to be used to begin
the exponent (i.e. as described on
while others permit 'e', 'E', 'd' or 'D' to be used (i.e. the MSVC CRT
described on http://msdn.microsoft.com/en-us/library/kxsfc1ab(VS.71).aspx
2008/11/3 Ken Smith <firstname.lastname@example.org>:
> 5.1.3 doesn't appear to accept D or d.
> Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> On Mon, Nov 3, 2008 at 11:30 AM, Dave Nichols <email@example.com>
>> The tonumber function appears to accept a 'D' (or 'd') as the exponent
>> character as well as the documented 'E' (or 'e'). Is this intended?
>> E.g. tonumber'2d2' returns 200
>> This is version 5.1.2 but there are no patches related to this up to 5.1.4
>> Dave Nichols
>> Match-IT Limited
>> Tel: 0845 1300 510
>> Fax: 0845 1300 610
>> Email Disclaimer: The contents of this electronic mail message and any
>> attachments (collectively "this message") are confidential, possibly
>> privileged and intended only for its addressee ("the addressee"). If
>> received in error, please delete immediately without disclosing its contents
>> to anyone. Neither the sender nor its management or employees will in any
>> way be responsible for any advice, opinion, conclusion or other information
>> contained in this message or arising from it's disclosure.