Biggest float number?

Paul Barrett Barrett at STScI.Edu
Wed Mar 28 16:11:09 CEST 2001


"C. S. Xu" wrote:
> 
> It seems the biggest floating number in Python can be:
>     2.**1024 - 1.
> which is about 1.8E308. Is there any way to get bigger value than this,
> just like long intergers almost have no limits?

Try using a log()-based algorithm, i.e. instead of multiplying two large
numbers together, take their log() and add them.

This approach has always worked for me, since I've found that precision
is usually less of an issue than range, when dealing with such large
numbers. 

-- 
Dr. Paul Barrett       Space Telescope Science Institute
Phone: 410-338-4475    ESS/Science Software Group
FAX:   410-338-4767    Baltimore, MD 21218



More information about the Python-list mailing list