Post Reply 
FORTRAN floating point accuracy problems
03-31-2016, 07:30 PM (This post was last modified: 04-01-2016 06:19 AM by Dieter.)
Post: #21
RE: FORTRAN floating point accuracy problems
(03-31-2016 02:45 PM)HP67 Wrote:  Mostly I'm using this to convert decimal time back and forth. .001 seconds should be plenty of resolution. I'll be happy with a reliable hh.mmsst for now.

OK, so ddd actually is hhh. ;-) What is the largest value you have to handle? Also, possibly two more digits could be obtained if the integer and fractional part of dms would be handled separately. But if 0.001 s is fine, the posted code is an easy solution.

(03-31-2016 02:45 PM)HP67 Wrote:  FORTRAN IV doesn't have any integer division except for integer types and doesn't have 8 byte integers.

That's exactly how the VBA code works. "Long" is a signed four-byte integer, and "\" is what Fortran does with a simple "/" division of two integers (12/5 = 2).

(03-31-2016 02:45 PM)HP67 Wrote:  In understanding your declarations, Excel VBA long means 8 byte int?

No, that's the same four bytes, i.e. integers within ±2^31. You should be able to translate this more or less 1:1 into Fortran. "Long" just means "Long integer", compared to a standard integer within ±32768.

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


Messages In This Thread
RE: FORTRAN floating point accuracy problems - Dieter - 03-31-2016 07:30 PM



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