Re: [Numpy-discussion] Unexpected float96 precision loss

2010-09-02 Thread Colin Macdonald
On 09/02/10 17:06, Christopher Barker wrote: > Does the clib for a compiler that provides a float64 also provide an > atof() function that supports it? Its seems that it should. I think so, for example in C I can do: fscanf(fp, "%Lf %Lf %Lf", &x, &y, &z); where x,y,z are "long doubles". The equ

Re: [Numpy-discussion] Unexpected float96 precision loss

2010-09-01 Thread Colin Macdonald
On 09/01/10 22:30, Michael Gilbert wrote: > Interesting. float96( '0.0001' ) also seems to evaluate to the first > result. I assume that it also does a float64( '0.0001' ) conversion > first. I understand that you can't change how python passes in floats, > but wouldn't it be better to exactly han

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread Colin Macdonald
On 08/18/10 15:14, Charles R Harris wrote: > However, the various constants supplied by numpy, pi and such, are > full precision. no, they are not. My example demonstrated that numpy.pi is only double precision. Thanks for your help so far. Colin ___

Re: [Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread Colin Macdonald
On 08/18/10 13:43, Charles R Harris wrote: > > > On Wed, Aug 18, 2010 at 3:46 AM, Colin Macdonald > mailto:macdon...@maths.ox.ac.uk>> wrote: > > How can I enter longdouble (float96) literals into my python/numpy > programs? In C, I would postfix such numbe

[Numpy-discussion] longdouble (float96) literals

2010-08-18 Thread Colin Macdonald
96(np.pi) print np.sin(mypi0) # in C, I would write: #mypi1 = 3.141592653589793238462643383279L mypi1 = 3.141592653589793238462643383279 print np.sin(mypi1) mypi2 = np.arctan2( f96(0), f96(-1) ) print np.sin(mypi2) OUTPUT: $ python f96_issue.py 1.22460635382e-16 1.22460635382e-16 -5.42101086243e-2