A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-December/050262.html below:

[Python-Dev] Re: long number multiplication

[Python-Dev] Re: long number multiplication [Python-Dev] Re: long number multiplicationNick Coghlan ncoghlan at iinet.net.au
Tue Dec 7 09:39:06 CET 2004
Christopher A. Craig wrote:
>>i needed to implement this myself and was thinking of storing the digits 
>>of an integer in a list.
> 
> 
> That's sort of what Python does except the "digits" are 15 bits,
> not base 10.  Doing it in base 10 would be a huge pain because of the
> problems with base 10->base 2 conversion.
>

Indeed. Python's Decimal data type stores the digits in a list for ease of power 
of 10 multiplication & rounding (the precision rules means a *lot* of that goes 
on). However, it converts that list of digits to a long integer in order to do 
addition, multiplication or division.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at email.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4