Re: [Tutor] numerical problem

2014-03-04 Thread Peter Otten
Gabriele Brambilla wrote: > for example I read this: > > On Pythons prior to 2.7 and 3.1, once you start experimenting with > floating-point numbers, you're likely to stumble across something that may > look a bit odd at first glance: 3.1415 * 2 # repr: as code (Pythons < 2.7 and 3.1) > 6.28

Re: [Tutor] numerical problem

2014-03-03 Thread Ben Finney
Gabriele Brambilla writes: > the values in www are like 1.01e-134 and also smaller, and I sum values > like this: there could be any problem summing so small numbers? The default floating-point number type in Python is a fixed-precision float http://docs.python.org/3/library/stdtypes.html#typesn

Re: [Tutor] numerical problem

2014-03-03 Thread Gabriele Brambilla
for example I read this: On Pythons prior to 2.7 and 3.1, once you start experimenting with floating-point numbers, you're likely to stumble across something that may look a bit odd at first glance: >>> 3.1415 * 2 # repr: as code (Pythons < 2.7 and 3.1) 6.2834 >>> print(3.1415 * 2) # s

Re: [Tutor] numerical problem

2014-03-03 Thread Gabriele Brambilla
ok, the things I get is very specific. my results differs from the other guy's ones with which I compare them for slightly details. We fit the data with a function and we obtain different but similar values. our fit routines on the same data return the same results. So we produce different data. t

Re: [Tutor] numerical problem

2014-03-03 Thread Steven D'Aprano
On Mon, Mar 03, 2014 at 08:00:52PM -0500, Gabriele Brambilla wrote: > Hi, > > I'm doing a sum in a for loop: > > www is the quantity I add. > > MYMAP[i, j, k] = MYMAP[i, j, k] + www > > MYMAP is a numpy array > > I have strong reasons to think that in this operation happens some > numerical er

Re: [Tutor] numerical problem

2014-03-03 Thread Danny Yoo
> I'm doing a sum in a for loop: > > www is the quantity I add. > > MYMAP[i, j, k] = MYMAP[i, j, k] + www > > MYMAP is a numpy array > > I have strong reasons to think that in this operation happens some numerical > error...Have you suggestions to discover where it is? Hi Gabriele, Can you expl

Re: [Tutor] numerical problem

2014-03-03 Thread Ben Finney
Gabriele Brambilla writes: > www is the quantity I add. > > MYMAP[i, j, k] = MYMAP[i, j, k] + www > > MYMAP is a numpy array Unfortunately, we have no idea what values are in ‘MYMAP’ nor ‘www’. So it's difficult for us to see what might be causing any problem, or even whether there is any proble

[Tutor] numerical problem

2014-03-03 Thread Gabriele Brambilla
Hi, I'm doing a sum in a for loop: www is the quantity I add. MYMAP[i, j, k] = MYMAP[i, j, k] + www MYMAP is a numpy array I have strong reasons to think that in this operation happens some numerical error...Have you suggestions to discover where it is? thanks Gabriele __

Re: [Tutor] numerical problem

2009-10-15 Thread Kent Johnson
On Thu, Oct 15, 2009 at 5:28 AM, Mr Timothy Hall wrote: > whenever i run this part of the program, no matter what values i put in for > vto, k1t etc... it always equals zero. > im slightly aware of floating point numbers but im not sure why this will > not give me a real answer. > when i do it on

Re: [Tutor] numerical problem

2009-10-15 Thread Andre Engels
On Thu, Oct 15, 2009 at 11:28 AM, Mr Timothy Hall wrote: >  hi, > i am writing a program for a runge-cutter method of solving ODE's and im > having a problem with one part. > > whenever i run this part of the program, no matter what values i put in for > vto, k1t etc... it always equals zero. > im

[Tutor] numerical problem

2009-10-15 Thread Mr Timothy Hall
hi, i am writing a program for a runge-cutter method of solving ODE's and im having a problem with one part. whenever i run this part of the program, no matter what values i put in for vto, k1t etc... it always equals zero. im slightly aware of floating point numbers but im not sure why this wi