> Correct, ARM's emulate hardware floating point using software.

That doesn't really say anything about compliance with standards/

________________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] On 
Behalf Of O'Neill, Owen [oone...@averyberkel.com]
Sent: Wednesday, November 04, 2009 9:36 AM
To: General Discussion of SQLite Database
Cc: Alexander Drozd
Subject: Re: [sqlite] SQLite on PocketBook

Correct, ARM's emulate hardware floating point using software.
And it's really slow too since it forces a context switch as the
processor spots it's been given a FP operation to do and has to jump
into the fp emulation.

If you are lucky enough to have control over it & depending on the level
of accuracy you need, I'd recommend storing everything as an integer
with a separate scalar.

Owen.



-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of D. Richard Hipp
Sent: Wednesday, November 04, 2009 3:26 PM
To: General Discussion of SQLite Database
Cc: Alexander Drozd
Subject: Re: [sqlite] SQLite on PocketBook


On Nov 4, 2009, at 4:53 AM, Alexander Drozd wrote:
>
>  My name is Alexander. I am working on an open-source  spaced-
> repetition software project  (http://code.google.com/p/pbanki/). My
> software relies on SQLite library. I came across some bug-like
> problems with running SQLite on a low-memory e-ink reader device. I
> am very  sorry to bother you, but I tried to submit my  problem to
> the bugtracker at the SQLite site, and for some reason anonymous
> login failed.
>
>  The problem appears at the point of reading real values from an
> SQLite database. I created a simple database
>
> CREATE TABLE cards (
>    text TEXT NOT NULL,
>    value REAL NOT NULL
> );
>
> I also tried to use NUMERIC and FLOAT instead of REAL. Then I
> inserted a few values:
>
> INSERT INTO cards VALUES('second',100.1);
> INSERT INTO cards VALUES('first', 100.0);
>
> Then I execute "select * from cards order by due" query with sample
> code from http://www.sqlite.org/quickstart.html It works perfectly
> when compiled on desktop computer, but fails on target device. The
> device is PocketBook301+ (http://pocketbook.com.ua/). Unfortunately
> their site does not have an English version. This device is based on
> Samsung S3C2440 AL-40 CPU. It runs under open-source firmware called
> pocketbookfree, that is based on Linux 2.6.18.2 armv4tl.
>
> The above query run on pocketbook returns corrupted values for
> floats if they have a non-zero fractional part:
>
> text = first
> val = 100.0
>
> text = second
> val = 1.90359837350824e+185
>
> Sorting by columns containing float numbers also fails when
> specified with ORDER BY. I am not sure whether this is an issue with
> SQLite or with cross-compiler for PocketBook, but I would greatly
> appreciate any suggestions on how to treat this problem.


I'm guessing that your hardward does not implement IEEE 754 floating
point correctly.  We've seen that sort of thing before, especially
with GCC.  There are some options to GCC (which escape my memory right
now) that can force it to use strict IEEE 754 floating point rather
than its preferred, speedier but non-standard alternative.


D. Richard Hipp
d...@hwaci.com



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

The information contained in this e-mail is privileged and confidential 
information intended only for the use of the individual or entity named.  If 
you are not the intended recipient, or the employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any disclosure, dissemination, distribution, or copying of this communication 
is strictly prohibited.  If you have received this e-mail in error, please 
immediately notify the sender and delete any copies from your system.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to