[Python-ideas] Python3.3 Decimal Library Released

Antoine Pitrou solipsis at pitrou.net
Tue Mar 4 00:01:22 CET 2014


On Tue, 04 Mar 2014 11:54:08 +1300
Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Mark H. Harris wrote:
> > One big issue that is going to confront everyone sooner than later is
> > cryptography. Fast bignum support, fast factoring, and fast transcendentals
> > are going to become more important
> 
> I don't see any reason that these have to be done in
> decimal, though. All the bignum arithmetic used in
> cryptography is integer, which is exact in any base.
> Also, the user never sees the resulting numbers as
> numbers. So the primary requirement is speed, which
> argues for binary rather than decimal, at least on
> current hardware.

For the record, int doesn't have a sqrt() method while Decimal has, so
if you wanna take the exact square root of a large integer, you'd better
convert it to a Decimal.

Regards

Antoine.




More information about the Python-ideas mailing list