Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-25 Thread Derek Klinge
arge values of N and get an accurate answer? How does the math module calculate the vale of e? Thanks, Derek On Mon, Apr 25, 2016 at 6:49 AM Oscar Benjamin wrote: > On 25 April 2016 at 08:39, Gregory Ewing > wrote: > > Derek Klinge wrote: > >> > >> Also, it seems

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Derek Klinge
e able to get the value of n used to generate that value e. If there is some other way to do that, I'd be happy to try it out. Thanks, Derek Derek On Sun, Apr 24, 2016 at 8:12 PM, Derek Klinge wrote: > Actually, I'm not trying to speed it up, just be able to handle a large

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Derek Klinge
place I had to multiply my value of N by approximately 10 (I found that the new N required was always < 10N +10). Derek On Sun, Apr 24, 2016 at 4:45 PM, Derek Klinge wrote: > Actually, I'm not trying to speed it up, just be able to handle a large > number of n. > (Thank you Ch

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Derek Klinge
Doesn't range(n) create a list n long? On Sun, Apr 24, 2016 at 10:21 AM Chris Angelico wrote: > On Mon, Apr 25, 2016 at 3:02 AM, Derek Klinge > wrote: > > My problem is this: my attempt at Euler's Method involves creating a > list of > > numbers that is n long. Is

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Derek Klinge
eGuess = 1 thisE = EulersNumber(1) while x <= abs(PowerOfTen): thisE = EulerStepWithGuess(10**(-1*x),theGuess) theGuess = thisE.eulerSteps * 10 x += 1 return thisE On Sun, Apr 24, 2016 at 10:02 AM Derek Klinge wrote: > Sorry about the code indentation, I was using Pythonista (iOS), and

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Derek Klinge
k On Sun, Apr 24, 2016 at 9:22 AM Chris Angelico wrote: > On Sun, Apr 24, 2016 at 1:05 PM, Derek Klinge > wrote: > > I have been writing a python script to explore Euler's Method of > > approximating Euler's Number. I was hoping there might be a way to make >

Optimizing Memory Allocation in a Simple, but Long Function

2016-04-23 Thread Derek Klinge
I have been writing a python script to explore Euler's Method of approximating Euler's Number. I was hoping there might be a way to make this process work faster, as for sufficiently large eulerSteps, the process below becomes quite slow and sometimes memory intensive. I'm hoping someone can give m