K.S.Sreeram wrote:
> Raymond L. Buvel wrote:
> > I just tried this and it is taking an extremely long time even on a fast
> > machine with 4 Gb of RAM. Killed it after a couple of minutes.
>
> You probably tried printing the value.
>
> a = 34564323**456356 (takes just 28 seconds)
> whereas
> b =
K.S.Sreeram wrote:
> Raymond L. Buvel wrote:
>> I just tried this and it is taking an extremely long time even on a fast
>> machine with 4 Gb of RAM. Killed it after a couple of minutes.
>
> Thats odd.
> 34564323**456356 completed on my laptop in 28 seconds.
> [Python 2.4.3, Celeron-M 1.3GHz, Win
[Wojciech Muła]
>> You have to use operator **, i.e. 34564323**456356
Or the builtin pow() instead of math.pow().
[Gary Herron]
> That's not very practical. That computation will produce a value with
> more than 3.4 million digits.
Yes.
> (That is, log10(34564323)*456356 = 3440298.) Python will
Raymond L. Buvel wrote:
> I just tried this and it is taking an extremely long time even on a fast
> machine with 4 Gb of RAM. Killed it after a couple of minutes.
You probably tried printing the value.
a = 34564323**456356 (takes just 28 seconds)
whereas
b = str(a) takes forever!
Regards
Sreer
Raymond L. Buvel wrote:
> I just tried this and it is taking an extremely long time even on a fast
> machine with 4 Gb of RAM. Killed it after a couple of minutes.
Thats odd.
34564323**456356 completed on my laptop in 28 seconds.
[Python 2.4.3, Celeron-M 1.3GHz, WinXP], and max memory consumption
Felipe Almeida Lessa wrote:
> Em Dom, 2006-06-11 às 11:19 -0700, fl1p-fl0p escreveu:
>> import math
>> math.pow(34564323, 456356)
>>
>> will give math range error.
>>
>> how can i force python to process huge integers without math range
>> error? Any modules i can use possibly?
>
> 34564323**45635
Wojciech Muła wrote:
> fl1p-fl0p wrote:
>
>> import math
>> math.pow(34564323, 456356)
>>
>> will give math range error.
>>
>> how can i force python to process huge integers without math range
>> error? Any modules i can use possibly?
>>
>
> You have to use operator **, i.e. 34564323**4563
fl1p-fl0p wrote:
> import math
> math.pow(34564323, 456356)
>
> will give math range error.
>
> how can i force python to process huge integers without math range
> error? Any modules i can use possibly?
You have to use operator **, i.e. 34564323**456356
--
http://mail.python.org/mailman/listinfo
Em Dom, 2006-06-11 às 11:19 -0700, fl1p-fl0p escreveu:
> import math
> math.pow(34564323, 456356)
>
> will give math range error.
>
> how can i force python to process huge integers without math range
> error? Any modules i can use possibly?
34564323**456356 ?
--
Felipe.
--
http://mail.pytho
import math
math.pow(34564323, 456356)
will give math range error.
how can i force python to process huge integers without math range
error? Any modules i can use possibly?
--
http://mail.python.org/mailman/listinfo/python-list
10 matches
Mail list logo