On 2-2-2018 17: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'm not sure I understand what you mean here.

We are talking about the the fact that DECFLOAT is backed by Decimal64 and Decimal128 (which BTW are IEEE-754 types), and that DECIMAL/NUMERIC with precision > 18 is also backed by Decimal128. So that in the protocol and API, they can be represented by the same type (with different subtypes).

Not sure what this has to do with float and double. Also note that the behavior of DECFLOAT (and Decimal64 / Decimal128 for that matter), is not the same as binary floating point types.

Mark
--
Mark Rotteveel

------------------------------------------------------------------------------
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 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to