db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Yves Linet <jy.li...@gmail.com>
Subject Re: Float versus Double
Date Tue, 25 Oct 2011 22:48:29 GMT
May be you should have read the doc before...
DOUBLE is 8 bytes and REAL is 4 bytes.

FLOAT depends of the precision you specified. Did you set a precision ?

<<The FLOAT data type is an alias for a REAL or DOUBLE PRECISION data type,
depending on the precision you specify.
The default precision for FLOAT is 53 and is equivalent to DOUBLE PRECISION.
precision of 23 or less makes FLOAT equivalent to REAL. A precision of 24 or
makes FLOAT equivalent to DOUBLE PRECISION. If you specify a precision of 0,
get an error. If you specify a negative precision, you get a syntax error.>>

2011/10/25 anthonyri <anthony.rich@inbox.com>

> Hi,
> I changed all my doubles to float expecting a smaller database, but the
> size
> was identical.
> I thought doubles were 8 bytes and floats only 4 bytes. I have over a
> million records in the database, with several doubles per record. I created
> a completely new database, identical in every respect, except all doubles
> were changed to floats and reimported the data.
> Can anyone explain why the database size was exactly the same?
> Thanks.
> Anthony
> --
> View this message in context:
> http://old.nabble.com/Float-versus-Double-tp32720294p32720294.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.

Jean-Yves LINET

View raw message