Straightforward calculation bug. ((2^127)/(2^63))*(2^63) != (2^127). This
prevents a reliable uint128<->numeric cast function (which is how I ran
into it). See below for test case. -Huw
] psql test
psql (16.2)
Type "help" for help.
test=# select ('170141183460469231731687303715884105727'::numeric /
'9223372036854775808'::numeric) * '9223372036854775808'::numeric;
?column?
-----------------------------------------
170141183460469231731687303715884105728
(1 row)