[SciPy-User] Decimal dtype

Nathaniel Smith njs at pobox.com
Tue Jul 28 16:42:55 EDT 2015


On Jul 28, 2015 7:12 AM, "Anne Archibald" <archibald at astron.nl> wrote:
>
> Is there a (hardware or not) fixed-size decimal format? Would that even
be useful?

The newer 2008 version of IEEE-754 does include specifications for
decimal32, decimal64, and decimal128 formats, and from the GCC docs it
sounds like there is some effort underway to add these to ISO C:
  https://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html

I don't think there'd be much appetite to add these to numpy core right
now, between the relatively rare use, our lack of devs who know about them,
and the inevitable compiler compatibility issues. But they could be
supported via a third-party library that provides these dtypes. This would
be possible right now; there are similar examples floating around for
adding rational and quaternion dtypes to numpy as third party libraries.
And then if this library proved to be solid and popular then it could
potentially later become part of numpy core.

Otherwise, yeah, object arrays are going to be the best bet for a quick
solution...

-n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20150728/356cc22a/attachment.html>


More information about the SciPy-User mailing list