On 1-2-2018 12:49, Dimitry Sibiryakov wrote:
01.02.2018 12:44, Mark Rotteveel wrote:
On 27-1-2018 19:30, Dmitry Yemanov wrote:
27.01.2018 20:18, Mark Rotteveel wrote:
I'm implementing the new precision 34 decimal/numeric support in
Jaybird, and I notice that the underlying Decimal128 is used as just
an integer container, instead of already applying an appropriate
exponent for the scale. This was a bit of a surprise to me.
Similar to how int16/int32/int64 is used for NUMERIC/DECIMAL with
precision <= 18.
Why was this implementation chosen?
To keep the existing logic that deals with exact numerics inside the
engine.
Right, good point, but given the backing datatype is different, I
wonder if that really simplifies things, and especially if that should
surface in the external API.
IMHO - it shouldn't. It unnecessary complicate application logic that
must handle such "special cases" every time it access data.
DECFLOAT is DECFLOAT. If you want 128-bits integer - use int128.
Decimal128 is a good format for DECIMAL (and should allow for easy
interoperating between DECIMAL and DECFLOAT both client and
server-side), I just don't like the fact that we make our API a lot more
confusing by just using it as an integer container in the case of DECIMAL.
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