- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a small number which I writing to a file with:
FORMAT (A14,1P,D22.12)
The number gets written as:
5.148200387154-130
ie. without the "D"
When I try to read it, it fails. Why is the "D" not being written? I guess it has something to do with the exponent being bigger than 99.
FORMAT (A14,1P,D22.12)
The number gets written as:
5.148200387154-130
ie. without the "D"
When I try to read it, it fails. Why is the "D" not being written? I guess it has something to do with the exponent being bigger than 99.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually if I read with D22.12 it reads OK, my read format statement was old. But it is rather strange.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The standard requires this behavior. You can get around it by using E22.12E3 for the format. Yes, you must give up on D for the exponent letter. Fortran will read that string, but other languages may not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>Yes, you must give up on D for the exponent letter. Fortran will read that string, but other languages may not.
Like Excel
Like Excel

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