Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Floating Point Error

Status
Not open for further replies.

Asta1

Programmer
Nov 9, 2005
2
GB
Can anyone help me?

I get a warning for this line saying Comparing floating point quantities for equality may give misleading results.
(step is an real)

DO TIME=0+STEP,15,STEP

I then get a run time error stating 'floating point co-processor fault at address 004014ee in file...'
at this line (the line it fails on varies depending on what step is set at but it's a similar equation)

VELK2=STEP*(((-DAMPC*(VELO+(VELK1/2)))-(SPRING*(DISP+(DISK1/2))))/MASS)

Can anyone shed some light on what might be causing this?

I'm running F95 on Windows 2000 Pro

Thanks
 
The easiest way to work out something like that is to break up the formula. It is possible that MASS is zero
 
Nope all the variables are set to a value
 
As xwb suggested, break the formula into little pieces.

Then you'll find where it gets screwed up.

 
Nice to see classical FORTRAN WITHEVERTHINGINCAPITALSWITHNOSPACESWHATEVER by the way...
 
Quite refreshing isn't it, Fortran written in its traditional form.
 
Yup.

Makes me want to fire up the card punch & start typing.

Or not...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top