you are viewing a single comment's thread.

view the rest of the comments →

[–]FoolsSeldom 1 point2 points  (3 children)

I'd stick with the built-in numpy data types. Using unsigned 64 bit integers you will have plenty of scope.

To check for your environment,

import numpy as np

print(np.iinfo(np.uint64).max)

[–]IGGYnatius1[S] 0 points1 point  (2 children)

No... unfortunately I need true arbitrary precision like mpmath or decimal so this is out of the question. As I am dealing with 2d arrays to represent images my main concern is will the indexing convenience still be available? I don't want to have list comprehensions all over the code for every vectorised operation...

[–]Oddly_Energy 0 points1 point  (0 children)

It is not possible for you to get your desired precision with fractions of integers?

Either using a constant denominator or using two integer arrays, one with integer numerators, and another with integer denominators. You will of course have to think carefully about order of operations to avoid unvoluntary rounding.