On 3-2-2018 09:39, Alex Peshkoff via Firebird-devel wrote:
Mark & others - this is missing email

  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

Yes.

and sqlscale is always zero for them.


No - it's not zero, it's according to initial DDL for a field. When
displaying a field it's used to correctly choose number of digits after
decimal point. (Double number may be something like 178500178500.17001
but with scale == -2 it will be displayed as 178500178500.17). For
decfloat there will be no need to play that games, correct number of
digits after decimal points will be enforced by engine, but notifying
user about the scale is anyway good idea, is not it?

I assume you mean the extended precision decimal instead of decfloat here. And yes, the user should be able to get the scale.

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?

Right. Decfloat format is looking much closer to double (has exponent
and coefficient parts) than to integer.

In some respects, yes, but in other it is a class of its own.

--
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