[Python-checkins] r77519 - in python/trunk: Lib/test/test_strtod.py Misc/NEWS Python/dtoa.c

Nick Coghlan ncoghlan at gmail.com
Sat Jan 16 16:34:56 CET 2010


Mark Dickinson wrote:
> On Sat, Jan 16, 2010 at 2:14 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> mark.dickinson wrote:
>>> +     *  - the nd significant digits are in s0[0:nd0] and s0[nd0+1:nd+1]
>>> +     *    (using the usual Python half-open slice notation)
>> Could you include something here as to what gets stored in s0[nd0]
>> between the two parts of the number? Always \0? An arbitrary value that
>> isn't used for anything? That would keep me from wondering if there was
>> an off-by-one error in the indices of the second slice.
> 
> Will do.
> 
> The quick answer is:  if nd0 != nd, then s0[nd0] will be the decimal point.
> If nd0 == nd, then s0[nd0] is probably either 'e', 'E', '.' or '\0',
> but it could
> actually be any character at all.
> 
> Note that s0 is just a pointer to the first significant digit in the input
> string s00;  it's not a newly-constructed char*.  I'll clarify this in the
> comments, too.

Thanks - while I was also interested in the details of the answer, it
was more the "no, really, that +1 is meant to be there" reassurance I
was after :)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------


More information about the Python-checkins mailing list