Skip to content

v1.7.4

Choose a tag to compare

@elliotchance elliotchance released this 23 Nov 08:57
· 26 commits to main since this release
34cbd4e
numbers: Add DECFLOAT arithmetic, comparisons and functions (#1622)

A DECFLOAT could only be stored and cast. Now it works with the arithmetic
operators, comparisons, the numeric functions (and the ROUND, TRUNC and SIGN
extensions), the aggregates and the combined types of CASE, UNION and VALUES,
with any other number.

The result of an operation with a DECFLOAT is a DECFLOAT with the larger
precision of the DECFLOAT operands. It's exact and then rounded half to even,
with the exponent that IEEE 754 prefers, so trailing zeros are kept (1.50 + 1
is 2.50). ABS, MOD, FLOOR, CEIL, SQRT, POWER with a whole number exponent,
ROUND, TRUNC, SIGN, SUM, AVG and the variances are exact before they're
rounded. The other functions (LN, EXP, the trigonometric functions) are
calculated with a DOUBLE PRECISION.

T076 is still partial, because the SQL descriptor areas of dynamic SQL don't
support DECFLOAT yet (#1620).

SQL T076

Part of #1475

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>