You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
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>