View previous topic :: View next topic |
Author |
Message |
PPPO
Joined: 04 Nov 2012 Posts: 6
|
Posted: Thu Dec 06, 2012 9:43 am Post subject: Invalid floating point operation |
|
|
Hi
I get the error:
"Invalid floating point operation"
What is wrong?
L=98
U0=0.1
NJM=99 |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Thu Dec 06, 2012 11:43 am Post subject: |
|
|
I cannot see anything obviously wrong with this so try breaking up the assignment into smaller parts so that the error is localised.
Use 4.0 etc for real constants if you are multiplying reals.
Also, if L is an integer then you are relying on the numerator being real to get real rather than integer division. |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Thu Dec 06, 2012 9:12 pm Post subject: Re: Invalid floating point operation |
|
|
PPPO wrote: |
What is wrong?
L=98
U0=0.1
NJM=99 |
I would guess these variables don't have these values in the expression you think they have. You should use the debugger to pause execution at this point and check the values are what you expect.
If they are different from what you expect, you need to trace backwards and find out how they got the values they have.
Paul's suggestion is a good one too. But as FTN95 has a brilliant debugger SBDG it would be shame not to use it to find your bug. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
|