[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Conversion of strings to numbers and numbers to strings.
- From: David Jones <drj@...>
- Date: Tue, 30 May 2006 12:54:59 +0100
On May 30, 2006, at 12:04, David Jones wrote:
By the way, I was surprised by the result of
return '-0x1' + 0
I was even more surprised when it gave a different answer on my
PowerPC OS X machine (where it gives -1) than on an Intel Windows XP
machine (where it gives 4294967295).
This turns out to be because on OS X strtod handles the conversion of
'-0x1', for which we can thank C99, and on Windows (I assume) strtoul
handles the conversion of '-0x1'. I find the whole situation rather