recovery

Andrew Sackville-West ajswest at mindspring.com
Fri Nov 2 14:02:31 EDT 2007


On Fri, Nov 02, 2007 at 09:32:35AM -0700, Michael Vrable wrote:
> On Fri, Nov 02, 2007 at 09:34:39AM -0400, Derek Atkins wrote:
> >Michael Vrable <vrable at cs.hmc.edu> writes:
> >>     SELECT * from Split where Split.amount_num * 3 = Split.amount_denom * 1;
> >
> > What size integers will it use internally?  Will it deal with a 64-bit 
> > number multiplied by a 64-bit number?  But yes, this is certainly one 
> > way to beat the rounding problem (and indeed it's what gnucash does 
> > internally with some special "128-bit" math routines.
> 
> Probably implementation specific; I don't know what the SQL 
> specification has to say on the matter.
> 
> I believe SQLite is limited to 64-bit arithmetic (see 
> http://www.sqlite.org/datatype3.html):
>      sqlite> select 123456789 * 123456789;
>      15241578750190521
>      sqlite> select 123456789 * 123456789 * 123456789;
>      -2204193661661244627
> 
> With PostgreSQL, on the other hand:
>      => select 1234567890123456789 * 123456789;
>      ERROR:  bigint out of range
>      => select cast(1234567890123456789 as numeric(100,0)) * 123456789;
>      152415787517146788750190521
> Here, the numeric(100,0) type will support up to 100-decimal digit 
> integers.  The value can be tweaked to give the necessary precision; 
> something about numeric(39,0) should do.  I don't know of a way to get 
> 128-bit integers specifically.

Isn't this the sort of implementation detail that we're hoping to
avoid by using a front-end like gda? maybe I misunderstand, but ISTM
that if this kind of functionality is needed, it should be provided by
gda and we don't care how its implemented behind gda. 

I realise this means that gnucash may have to provide code upstream
into gda to provide this functionality, but that's a different
issue. Gnucash shouldn't give a rat's ass what *sql is behind gda and
should just call for data from gda in a manner that suits gnucash's
need.

educate me. :-) please

A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.gnucash.org/pipermail/gnucash-user/attachments/20071102/f64d4545/attachment.bin 


More information about the gnucash-user mailing list