Dick Moores wrote:
> I pinched it down some more (after dinner):
>
> >>> 1.79769313486e+308 * (1.001 ** 1160)
> 1.7976931348623151e+308
> >>> 1.79769313486e+308 * (1.001 ** 1161)
> 1.#INF
This looks promising:
In [8]: x=1.7976931348623157e+308
In [9]: y=0.000
At 06:01 PM 9/24/2007, Terry Carroll wrote:
>On Mon, 24 Sep 2007, Christopher Spears wrote:
>
> > How can I find the largest float and complex numbers?
>
>That's an interesting question..
>
>I just tried this:
>
>x = 2.0
>while True:
> x = x*2
> print x
> if repr(x) == "1.#INF": break
>
Christopher Spears wrote:
> One of the exercises from Core Python Programmng (2nd
> Edition) asks me to determine the largest and smallest
> integers, float, and complex numbers my system can
> handle. Using python.org and Google, I have
> discovered my system's largest and smallest ingtegers:
>
林培恒 wrote:
> On Mon, 24 Sep 2007, Terry Carroll write:
>
>> My math is rusty. Is there a concept of "greater than"
>> or "largest" in complex numbers on different axis? Which
>> is larger, 4+2i or 2+4i?
>
> In fact, complex numbers can not compare directly. People always compare
> complex numbe
On Tue, 25 Sep 2007, John Fouhy wrote:
> You've got upper and lower bounds - maybe you could do a binary search
> to find the max exactly? It should only take the same number of steps
> again...
I thought of that; and then I thought I'd rather go home and have dinner.
___
On Mon, 24 Sep 2007, Terry Carroll write:
>My math is rusty. Is there a concept of "greater than"
>or "largest" in complex numbers on different axis? Which
>is larger, 4+2i or 2+4i?
In fact, complex numbers can not compare directly. People always compare
complex numbers with their 'model'. For
You've got upper and lower bounds - maybe you could do a binary search
to find the max exactly? It should only take the same number of steps
again...
On 9/25/07, Terry Carroll <[EMAIL PROTECTED]> wrote:
> On Mon, 24 Sep 2007, Christopher Spears wrote:
>
> > How can I find the largest float and com
Christopher Spears wrote:
> How can I find the largest float and complex numbers?
I don't know how to do this in standard Python. Here are some answers
that use Numeric and numpy:
http://groups.google.com/group/comp.lang.python/msg/fa7a761411ced62b
http://www.thescripts.com/forum/post2028282-8.h
On Mon, 24 Sep 2007, Christopher Spears wrote:
> How can I find the largest float and complex numbers?
That's an interesting question..
I just tried this:
x = 2.0
while True:
x = x*2
print x
if repr(x) == "1.#INF": break
to just keep doubling X until Python began representing it as
One of the exercises from Core Python Programmng (2nd
Edition) asks me to determine the largest and smallest
integers, float, and complex numbers my system can
handle. Using python.org and Google, I have
discovered my system's largest and smallest ingtegers:
>>> import sys
>>> sys.maxint
21474836
10 matches
Mail list logo