Post Reply 
FORTRAN floating point accuracy problems
03-27-2016, 10:47 PM
Post: #3
RE: FORTRAN floating point accuracy problems
For this kind of problem, I find first dealing with the sign and then getting into an integer domain as fast as possible and then applying corrections there is usually the best approach.

You've got integer degrees already, multiply by 60 and get integer minutes, then again by sixty to get seconds (which will have to stay real). Then sanity check everything to deal with the corner cases.

You'll end up with a pile of code along the lines of:

Code:
if seconds .ge. 60 then
  seconds = seconds - 60
  minutes = minutes + 1
endif

- Pauli
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: FORTRAN floating point accuracy problems - Paul Dale - 03-27-2016 10:47 PM



User(s) browsing this thread: 5 Guest(s)