View previous topic :: View next topic |
Author |
Message |
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Sun Sep 02, 2018 11:24 pm Post subject: Puzzled by warning |
|
|
The test code
Code: | implicit none
real t,ftbl
t=0.5
ftbl = 3.0/(1.0+t) - 2.0*t + 1.0
print *,ftbl
end |
causes the 8.30.279 compiler to issue a puzzling warning:
Code: | 0004) ftbl = 3.0/(1.0+t) - 2.0*t + 1.0
WARNING - A REAL constant has been truncated with possible loss of precision - maybe a KIND is required |
Older versions of the FTN95 compiler, such as 8.0 and 7.2, do not issue this warning with the same source code. Moving the "1.0" from the end to the beginning of the right hand side expression makes the warning go away. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Mon Sep 03, 2018 7:45 am Post subject: |
|
|
Thank you for the feedback.
A new warning was recently added for loss of precision when single precision real constants are used in double precision expressions. The warning here means that at least some of the arithmetic is actually being carried out in double precision (or potentially so from the compiler's point of view).
I have made a note that we should try to fix this. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Mon Oct 29, 2018 3:43 pm Post subject: |
|
|
This has now been fixed for the next release of FTN95. |
|
Back to top |
|
|
|