View previous topic :: View next topic |
Author |
Message |
KL Guest
|
Posted: Thu Mar 27, 2008 6:23 pm Post subject: Problem with exponent (nearest...) |
|
|
Dear Paul,
Test49 shows that the statement
exponent (nearest(RX, RX)-RX)-1
gives a wrong result. It seems also that the “+” sign in
nearestRX = nearest(RX,+RX)
is not allowed.
I have run the test with FTN95 Version 5.20.
Klaus Lassmann
Code: |
Winapp
Program Test49
Implicit None
Integer :: machep,negep
Real , Parameter :: RX=1.0
Real :: nearestRX
nearestRX = nearest (RX, RX)
machep = exponent (nearestRX-RX)-1
nearestRX = nearest (RX,-RX)
negep = exponent (nearestRX-RX)-1
Write (*,*) 'machep = ', machep
Write (*,*) ' negep = ', negep
! --- This form should be formally correct, but
! gives a wrong result without warning
machep = exponent (nearest(RX, RX)-RX)-1
negep = exponent (nearest(RX,-RX)-RX)-1
Write (*,*) 'machep = ', machep
Write (*,*) ' negep = ', negep
! --- the following form leads to
! "floating point stack overflow"
! nearestRX = nearest(RX,+RX)
End Program Test49
|
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Thu Mar 27, 2008 7:41 pm Post subject: |
|
|
Is the problem only with version 5.20 and have you tried the patch (version 5.20.1)? |
|
Back to top |
|
|
KL Guest
|
Posted: Fri Mar 28, 2008 3:03 pm Post subject: |
|
|
I have run it with 5.20 |
|
Back to top |
|
|
KL Guest
|
Posted: Tue Apr 22, 2008 4:27 pm Post subject: above problem |
|
|
Can I do anything further for clarifying the problem?
Klaus |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Tue Apr 22, 2008 7:27 pm Post subject: |
|
|
Thank you for reminding me about these bugs.
They do not need further clarification.
We will investigate them as soon as we can. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Wed Apr 23, 2008 8:22 am Post subject: |
|
|
Both the bugs only occur when RX is declared as a PARAMETER.
The result is that FTN95 tries to do all of the coding inline and gets it wrong. |
|
Back to top |
|
|
KL Guest
|
Posted: Wed Apr 30, 2008 5:10 pm Post subject: |
|
|
But declaring RX as a parameter is not wrong, or? In this case it is very simple to circumvent the problem, but this is not always the case. So I would suggest to really solve this problem.
Best regards,
Klaus |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Wed Apr 30, 2008 7:15 pm Post subject: |
|
|
Sorry I did not express myself clearly.
We do intend to fix this bug.
My comment presents a temporary work-around. |
|
Back to top |
|
|
KL Guest
|
Posted: Sat May 03, 2008 9:02 am Post subject: |
|
|
Thank you very much Paul,
there is no hurry from my side. As I knew already a workaround I just thought it a good idea to inform you.
Best regards,
Klaus Lassmann |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Mon Jun 16, 2008 1:57 pm Post subject: |
|
|
This bug has now been fixed. |
|
Back to top |
|
|
|