[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Computation time for newcommer
From: |
Joza |
Subject: |
Computation time for newcommer |
Date: |
Tue, 25 Sep 2012 04:46:25 -0700 (PDT) |
Hi guys, new here!
So I'm trying to compute the value of pi using a series with a billion terms
(n):
for i=1:1:n
x(i) = ( (-1)^(i + 1) ) / ( (2*i) - 1 );
end
% Sum all the values in the vector x
value = 4*sum(x)
When I run this however, nothing happens ... I just get a blinking prompt
and have to CTRL+C to get back to normal.
I'm running on a 1.3GHz 64-bit machine with 4GB RAM. I'm fairly new to
numerical computation, but why is this happening? Is the number of terms too
large for my machine? A million terms computes in about 30 or so seconds?
--
View this message in context:
http://octave.1599824.n4.nabble.com/Computation-time-for-newcommer-tp4644594.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Computation time for newcommer,
Joza <=