Re: IEEE 754 double floats

2004-11-16 Thread Adam Warner
Hi Brent 'Dax' Royal-Gordon, option. Yet the Leibniz summation for PI http://www.parrotcode.org/examples/ still appears to be performing its calculations using single floats and continues to print 3.141591. Parrot usually uses double as its floating-point type. The problem is probably

Re: IEEE 754 double floats

2004-11-16 Thread Adam Warner
This may be the long double version that I compiled :-) Note: I've rebuilt parrot-latest.tar.gz (I believe it was 2004-11-16_00) at default settings on Debian unstable 2.6.8.1 i686 GNU/Linux. I'm still printing floats that appear to be 128-bit precision! Regards, Adam

Re: IEEE 754 double floats

2004-11-16 Thread Leopold Toetsch
Adam Warner [EMAIL PROTECTED] wrote: On a windows binary I downloaded the precision is indeed double (~16 decimal places). With my current Linux binary it's extreme (here's 60 decimal places): PI is (very) approximately: 3.1415906535896946927266526472521945834159851074218750

Re: IEEE 754 double floats

2004-11-16 Thread Adam Warner
Hi Leopold Toetsch, PI is (very) approximately: 3.1415906535896946927266526472521945834159851074218750 ^ 3.141592653589793238462643383279502884197169399375105820974944 You might probably want to run more iterations ;) And you'll never get 60 digits out of long

Re: IEEE 754 double floats

2004-11-16 Thread Leopold Toetsch
Adam Warner [EMAIL PROTECTED] wrote: In other words sprintf is printing trailing garbage: Well, the underlaying architecture is defining the precision of floats. And due to the binary nature of the representation of floats they are mostly just and inprecise approximation of a given float value

Re: IEEE 754 double floats

2004-11-16 Thread Bill Coffman
Another way is to count the bits, as in the following: .sub _main N1 = 1 N2 = 0.5 I0 = 0 REPEAT: I0 = I0 + 1 N2 = N2 / 2 N3 = N1 + N2 ne N1, N3, REPEAT print I0 print bits precision\n end .end On Wed, 17

IEEE 754 double floats

2004-11-15 Thread Adam Warner
Hi all, I've taken a first look at Parrot and I'm very impressed. I'd like to perform some micro-benchmarking of double floating point code. I have the latest CVS version of parrot. I've compiled it upon Debian unstable x86 with the: perl Configure.pl --floatval=double option. Yet the

Re: IEEE 754 double floats

2004-11-15 Thread Brent 'Dax' Royal-Gordon
Adam Warner [EMAIL PROTECTED] wrote: I've taken a first look at Parrot and I'm very impressed. I'd like to perform some micro-benchmarking of double floating point code. I have the latest CVS version of parrot. I've compiled it upon Debian unstable x86 with the: perl Configure.pl