Numba with decimal package for increasing the accuracy

Hi everyone,

Do you know if numba has the format for decimal value type? Or anything else to increase the accuracy of float value?

For example: I have a guvectorize here

guvectorize([(float64[:,:], float64, float64[:,:])], ‘(m,n),()->(m,n)’)

is that possible to change to something like

guvectorize([(float64[:,:], float64, decimal[:,:])], ‘(m,n),()->(m,n)’)

Please help me with solution for this. Thank you.

Numba doesn’t presently support decimal types. I would expect that will be possible to add support for it using a Numba extension (see Extending Numba — Numba 0.55.0.dev0+438.g3131959c9.dirty-py3.7-linux-x86_64.egg documentation), but it will require some knowledge / study of how Numba works and the documentation if it’s an area you’ve not looked into before.

1 Like

I’m also investigating this as part of my work. Would there be any interest in upstreaming this if that’s the route I go down?