As an academic exercise, I am trying to achieve an arbitrary precision (call it AP) system in google app engine using python and the NDB storage. I know that there are AP libraries out there so we can skip that.
I am curious how one might store the numbers from an AP library in a way that they could be query-able with greater than, less than, and equal operators. Ideally, this could be done using a custom property class within the NDB model, but since the NDB model uses Python and Python does not support AP numbers natively, I am not sure this is possible. If you guys agree, then we can move on to talking about storage generally - SQL, MongoDB, NDB, etc.
As I understand them, AP systems often separate the AP number into coefficients (in an array?), an exponent, and a sign. If we stored these, is there a combination of filters on these fields that could achieve a greater than, less than, and equals operations? Is it even possible to store the coefficient if it is indeed stored as an array?
Thanks in advance!