The problem is that on ARM there are two ways to represent 64bit
floating point numbers when using software floating point emulation,
FPA and VFE. FPA uses little endian byte order but big endian word
order and is the default for most GCC configurations (why, I have no
idea...). VFE is fully little endian and is required if your code may
ever run on any of the chips with HW FP co-processors. If your system
is setup to use FPA you can define the SQLITE_MIXED_ENDIAN_64BIT_FLOAT
flag to get SQLite to properly construct floats/doubles that the rest
of the system will understand.

-Jeff

On Tue, Feb 26, 2008 at 2:38 AM, Michael Penkov <[EMAIL PROTECTED]> wrote:
> Hello,
>
>  I'm attempting to use sqlite3 (version 3.5.6, cross-compiled using gcc
>  2.95.3) on a Sharp Zaurus CL-3200.  Kernel is Linux 2.4.20, armv5tel,
>  using NetWinder Floating Point Emulator V0.95.
>
>  Overall, it works well, but I am encountering strange problems with
>  reading and writing floating point values.
>
>  Here is a file to reproduce the problem:
>  http://repose.ath.cx/tracker/anki/file99/sqlite.tar.gz
>
>  sqlite.tar.gz contains the databases created on a PC and a Zaurus.  There is
>  only one table (float_test) with a single column (float) with a single row
>  (contains value 1.1).  Data type for float is numeric(10,2).  Run
>  test.sh to see how
>  differently 1.1 is represented between the two platforms.
>
>  Could someone explain why this is so, and suggest what could be done
>  to solve the problem?  Ideally, I would like the database to be
>  transferable between different platforms.
>
>  A colleague using a Zaurus (albeit a different O/S) has also
>  reproduced the issue.  His specs were:
>
>  Linux kurobox 2.6.20 #1 PREEMPT Thu Aug 30 15:58:28 UTC 2007 armv5tel 
> GNU/Linux
>  NetWinder Floating Point Emulator V0.97 (double precision)
>  debian libsqlite3-0 3.4.2-2
>
>  A small discussion we've been having about the issue is located here:
>  http://repose.ath.cx/tracker/anki/issue436, in case I've missed
>  anything in this initial post.
>
>  Looking forward to your replies.
>
>  Cheers and regards,
>  Michael
>  _______________________________________________
>  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

Reply via email to