Numeric literals and INT128 (including numeric types) vs DECFLOAT

8 views
Skip to first unread message

Mark Rotteveel

unread,
May 13, 2021, 8:40:54 AM5/13/21
to firebird...@googlegroups.com
I'm in the process of writing the Firebird 4.0 Language Reference, and
I'm noticing some odd things with numeric literals and INT128 (including
numeric types) and DECFLOAT.

1. Integer hex literals don't support INT128 (reported as
https://github.com/FirebirdSQL/firebird/issues/6809)

2. Exact numeric literals with 30 or more digits are handled as
DECFLOAT(34), they should be handled as INT128 or DECIMAL/NUMERIC backed
by INT128 (as those types support 38 digits; actually 39 for INT128).

The cut off point for handling long exact numeric literals should be at
38 digits (or maybe, if no decimal point is present, at INT128 max of
7FFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF), longer values should be
handled as DECFLOAT.

I haven't created a ticket for point 2 yet, as I was wondering if maybe
this was a deliberate choice, or is this a left-over of the earlier
situation when high-precision numerics were backed by DECFLOAT?

Mark
--
Mark Rotteveel

Mark Rotteveel

unread,
May 13, 2021, 8:47:25 AM5/13/21
to firebird...@googlegroups.com
Please ignore this message, it should have gone to the firebird-devel list.

Mark
Reply all
Reply to author
Forward
0 new messages