On 9/5/07, Simon Davies <[EMAIL PROTECTED]> wrote:
[...]
> in sqlite3VdbeMemStringify.
> This resolves down to calling a function vxprintf, which has the following 
> line:
>
>    while( realvalue>=10.0 && exp<=350 ){ realvalue *= 0.1; exp++; }
>
[...]
> Interestingly, if the line is changed to
>    while( realvalue>=10.0 && exp<=350 ){ realvalue /= 10; exp++; }
> then the accumulated error is less, and the correct value is printed.
> Of course, this change may break other builds.
>
> One wonders why XP/VC++ produces such a large error in its floating
> point manipulations that appears to be avoided by other compilers.

What about defining __STD_IEC_559 before the compilation?
Acording to this:

   http://david.tribble.com/text/cdiffs.htm#C99-iec60559

C99 allows one to force the compiler to follow the standard, so maybe
libc does it by default, but the official sqlite compiled version
(which IIRC is linked with the old Microsoft C runtime DLL) doesn't.


Regards,
~Nuno Lucas


>
> Rgds,
> Simon

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to