- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
Im a doubt: I need use double float numbers but I wish that these numbers have a fixed accuracy of only 3 or 4digits. For example:
REAL*8TOUT, BUF(5000,17)
TOUT = (BUF(i,17) - BUF(i-1,17))*60.0D0
resulting in (for example):
TOUT= 10.2839999999995
But I need that this number is rounded to 10.2840000000000.
Does anybody know how I can resolve this problem?
Thanks
IlexSP
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From what you posted, I don't know whether you have unrealistic expectations, or have overlooked the Fortran FORMAT specifications, or ..... ?
When you take the difference of two nearly equal binary values, with bits just sufficient to represent 15 or more decimal digits, the results you got are to be expected.
When you take the difference of two nearly equal binary values, with bits just sufficient to represent 15 or more decimal digits, the results you got are to be expected.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page