--- [EMAIL PROTECTED] wrote:
> Going into this statement on both Linux and Windows,
> the exact same values are in realvalue and in rounder:
>
>realvalue: 0xf000 0.94995559107901499373838
>rounder:0x3faa 0.0500030
>
PROTECTED]
Sent: 10 June 2007 21:34
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] error in round-function?
Thanks to RBS and Alberto for testing...
So it seems the problem is somehow Windows-related
(maybe the VC-Compiler).
Think I'll override the Round-Function in my wrapper.
Regards
--- Olaf Schmidt <[EMAIL PROTECTED]> wrote:
> On what OS have you tested?
> If on windows, was it a GCC-compile or a MS-VC-compile?
Running the GCC cross-compiled sqlite3.exe from
http://www.sqlite.org/sqlite-3_3_17.zip on Windows
(well, wine on Linux):
SQLite version 3.3.17
Enter ".help"
Olaf Schmidt <[EMAIL PROTECTED]> wrote:
>
> select round(0.95, 1)
> gives 0 - not 0.9 (in case rounding down) and
> also not 1.0 (in case rounding up)
>
I can reproduce the problem by running sqlite3.exe on
windows. But I cannot explain it.
The problem occurs in printf.c on line 454:
Thanks to RBS and Alberto for testing...
So it seems the problem is somehow Windows-related
(maybe the VC-Compiler).
Think I'll override the Round-Function in my wrapper.
Regards,
Olaf
--
View this message in context:
http://www.nabble.com/error-in-round-function--tf3897765.html#a11052069
On 6/10/07, Olaf Schmidt <[EMAIL PROTECTED]> wrote:
> > select round(0.95, 1)
> 0.9
> > select round(9.95, 1)
> 9.9
> > select round(0.995, 2)
> 0.99
> > select round(9.995, 2)
> 9.99
> (3.3.17 here)
As it should be, hmm.
On what OS have you tested?
If on windows, was it a GCC-compile or a
> > select round(0.95, 1)
> 0.9
> > select round(9.95, 1)
> 9.9
> > select round(0.995, 2)
> 0.99
> > select round(9.995, 2)
> 9.99
> (3.3.17 here)
As it should be, hmm.
On what OS have you tested?
If on windows, was it a GCC-compile or a MS-VC-compile?
Olaf
--
View this message in context:
On 6/10/07, Olaf Schmidt <[EMAIL PROTECTED]> wrote:
Hi drh,
> http://www.sqlite.org/faq.html#q18
Not so easy I think (I'm well aware of rounding-problems
regarding the IEEE-Float-Formats, etc.).
Bankers rounding aside at the moment.
select round(0.95, 1)
0.9
select round(9.95, 1)
9.9
Hi drh,
> http://www.sqlite.org/faq.html#q18
Not so easy I think (I'm well aware of rounding-problems
regarding the IEEE-Float-Formats, etc.).
Bankers rounding aside at the moment.
select round(0.95, 1)
gives 0 - not 0.9 (in case rounding down) and
also not 1.0 (in case rounding up)
Funny
Olaf Schmidt <[EMAIL PROTECTED]> wrote:
> The integrated round-function works well so far,
> especially because it does "bankers rounding".
> Tough it seems to have a little bug, wich is probably simple to fix.
>
> Try...
> select round(0.94, 1) -> gives 0.9, wich is correct
> select round(0.96,
Olaf Schmidt <[EMAIL PROTECTED]> wrote:
> The integrated round-function works well so far,
> especially because it does "bankers rounding".
> Tough it seems to have a little bug, wich is probably simple to fix.
>
> Try...
> select round(0.94, 1) -> gives 0.9, wich is correct
> select round(0.96,
11 matches
Mail list logo