pg-bignum initial release

2 views
Skip to first unread message

Bear Giles

unread,
Jul 19, 2015, 12:59:09 PM7/19/15
to pgxn-...@googlegroups.com
FYI I've put up the first of those extensions, pg-bignum. Under KISS it only implements the basic arithmetic and comparison operators.

You can cast FROM an int4 and int8 but cannot cast TO an int4 or int8 due to concerns about overflows. Tell me how handle that and I can quickly add it.

You cannot cast between a bignum and decimal/numeric because of concerns about how to handle the fractional part - I don't want to introduce a situation where the system will cast a numeric to a bignum while losing the fractional part, do something to it, then cast the results back to a numeric.

I'm still on the fence about adding functions to generate a random prime number and to test a number for primality. On the one hand that could be useful but on the other hand that's getting into crypto range when the numbers have hundreds of digits.

I'm also on the fence about adding functions that read and write the values as hex strings. I'll probably add it as the need arises.

Bear
Reply all
Reply to author
Forward
0 new messages