Anyone know how to handle numbers larger than long in kdb+?
I need to handle numbers with 20+ digits in kdb+. It seems there is no inbuilt data types for this, other than to store the number as a string or hex.
Does anyone know any KDB+ libraries to do hex math i.e. addition, multiplication on hex / binary numbers?
Alternatively, any C libraries to use?
Best,
Alexander
Hi Alexander,
I think __int128 is available in GCC as an extension. I would store those 16byte ints as guids on the kdb side and develop the necessary functions in C.
This is interesting, I might come back to you with some prototype code today/tomorrow.
Regards,
Andras
To anyone looking for Big Integer arithmetic in future, I made a C library to integrate into kdb at:
https://github.com/manifoldfinance/qBigInt
Another option, GCC’s __int128 extension as guid:
https://github.com/adotsch/c-extensions-to-q