02.02.2018 19:08, Alex Peshkoff wrote:
On 02/02/18 19:40, Dimitry Sibiryakov wrote:
02.02.2018 17:25, Alex Peshkoff via Firebird-devel wrote:
I.e. to represent NUMERIC/DECIMAL(M, N) where M > 18 will be used SQL_DEC34 with sqlsubtype 1/2? But what should be the value of sql_scale? On the one hand in should be non-zero to let user know how many digits after decimal point may be used. On the other - for non-zero scale in numeric fields we always used to follow the rule: value = basic-type-value * pow(10, -scale) but most of people here tend to require SQL_DEC34 to be already scaled correctly.

  Because SQL_DEC* values according to IEEE are, actually, floating-point values, they must be treated the same way as SQL_FLOAT and SQL_DOUBLE, IMHO.

I.e. like numerics based on SQL_DOUBLE in dialect 1?

  Yes. AFAIR, they are not scaled and sqlscale is always zero for them.

For scaled integers (SQL_LONG, SQL_INT64) the value is supposed to be a real integer which, for example, can be divided by 2 using bitwise shifts. AFAIU, fixed decfloat cannot be divided this way, right?

  WBR, SD.

Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 

Reply via email to