View previous topic :: View next topic |
Author |
Message |
Anonymous Guest
|
Posted: Tue Jul 05, 2005 6:59 am Post subject: Real*10 |
|
|
Hello,
I want to run a program with real*10 (and complex*20) commands. How do I define a real number and the intrinsics:
For double precision we have for example: 1.0d0 and dsqrt(2.0d0) ;for a number and the square root we use a "d". For single precision, we use a "e" instead. What do I have to use for this extended precision?
Rutger |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Tue Jul 05, 2005 10:35 am Post subject: Real*10 |
|
|
Here is a simple example.
The intrinsics have generic names as well as specific names.
SQRT is used here and is generic.
INTEGER,PARAMETER::rkind = SELECTED_REAL_KIND(1
REAL(rkind) x
x = 4.0_rkind
PRINT*, SQRT(x)
END |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Wed Jul 06, 2005 1:21 am Post subject: Real*10 |
|
|
Thank you for your quick response,
It is working fine now. However, what should I put when I have a real number like "1.0d-12". I have tried several options like 1.0_rkind-12..., but they won't work. Hope to hear from you soon and thanks again.
Rutger |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Wed Jul 06, 2005 2:23 am Post subject: Real*10 |
|
|
x = 1.0e-12_rkind |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Wed Jul 06, 2005 3:01 am Post subject: Real*10 |
|
|
Thank you very much,
it is working!
Greetings rutger |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Wed Jul 06, 2005 9:34 am Post subject: Real*10 |
|
|
Sorry, one more time...
I have a NAG libraray installed special for the salford compiler. However, can it be that these routine cannot handle this extended precision?
Greetings Rutger |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Jul 07, 2005 1:52 am Post subject: Real*10 |
|
|
I am not familiar with the NAG library.
The NAG library manual will tell you the type and precision of the arguments.
My guess is that floating point arguments will be REAL*8. |
|
Back to top |
|
|
|