On 11/13/16 18:06, Dmitry Yemanov wrote: > 11.11.2016 18:26, Dimitry Sibiryakov wrote: > >>> - Added new datatypes: DECFLOAT(16) and DECFLOAT(34), using 64/128 bits >>> for numbers representation. >> What is the point of these new types? Cannot you just expand list of >> back-end storage >> for standard DECIMAL? > This is my concern too. What is the user-visible difference between > NUMERIC(15) based on blr_int64 and DECFLOAT(15) based on blr_dec64? Are > both arithmetics compatible and if not then why? I bet we have a demand > for longer standard NUMERICs rather than for non-standard DECFLOAT.
Decimal float is certainly more than numeric. It's much closer to floating point number - but free from binary exponent disadvantage: SQL> CREATE TABLE TESTDECFLOAT CON> ( CON> FEE_DECFLOAT DECFLOAT(16), CON> FEE_REAL REAL, CON> PERCENTAGE DECFLOAT(16) CON> ); SQL> SQL> INSERT INTO TESTDECFLOAT VALUES ( 0.70, 0.70, 0.05); SQL> SQL> SELECT * FROM TESTDECFLOAT; FEE_DECFLOAT FEE_REAL PERCENTAGE ======================== ============== ======================== 0.70 0.69999999 0.05 SQL> > Moreover, what are we going to do when people ask as for precisions > beyond the 34 decimal digits? Introduce blr_dec256/blr_dec512/etc or > switch to blr_varydec backed by decNumber (and probably stored as packed > BCD)? Are there any reasons why the current implementation doesn't > follow this way other than hardware accelerated computations for 64/128 > bits? > Use of unlimited length fields is certainly great but I suppose we should switch to it in future versions (including unlimited length strings). Better precision calculations are needed right now, in v.4. ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel