- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found a bug very annoying
that is when I use a module
such as :
module modAll
real(8) :: xmin=20624644.1898306, ymin=3287818.10173523
end module modAll
however when in program main to use modAll,
the xmin and ymin become integer,
that is xmin = 20624644.0 ymin = 3287818.0
how to solve this bug?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@phost75 this is not an error but according to the standard.
Since you do not specify a 'kind' value, 20624644.1898306 is single precision. 20624644.1898306 cannot represented in single precision so it gets truncated.
20624644.1898306_8 is what you need. (I would recommend to move away from (8) and use real64 or any other user defined kind parameter.)

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