PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

basic question about precision

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Sandy



Joined: 02 Sep 2005
Posts: 1

PostPosted: Fri Sep 02, 2005 2:13 am    Post subject: basic question about precision Reply with quote

I saw in the faq that extended precision should be default for the pgf90 compiler, but I don't seem to be getting that.
I'm working on a supercomputer (cluster of 64-bit machines) in England (JET, Abingdon) which is using your compiler.
I'm testing the precision by running a programme which is doing the simple division of 1.d0/3.d0 (in complex notation)

Compilation is done by
pgf90 -pc 80 -r8 -Kieee prog.f

After running this, I still only get 16 significant digits in stead of 32.
Both -pc 80 and -pc 64 give exactly the same result. Variables are declared as double precision and complex*16

Can somebody help me in solving this (basic) problem?
Back to top
View user's profile
brentl



Joined: 20 Jul 2004
Posts: 132

PostPosted: Fri Sep 02, 2005 4:04 pm    Post subject: Reply with quote

First, on 64-bit machines the -pc 64 and -pc 80 don't apply, since the
arithmetic is not done on the floating point stack, but in the SSE registers.

Complex*16 is equivalent to real*8 real and real*8 imaginary, i.e. 64 bit
floating point arithmetic.

In 64 bit floating point arithmetic, you have 1 sign bit, 11 exponent bits,
and 52 mantissa bits (plus an implied 1.xxx)

These are binary bits. Roughly it takes ~3 or 4 binary bits for each decimal digit of precision.

So, getting 16 significant digits of precision out of 52 bits is correct.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group