- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just have a quick question.
This simple program
[fortran]
program WriteHuge
implicit none
print *, huge(0.0d0)
write(*, *) huge(0.0d0)
write(*, '(E24.16)') huge(0.0d0)
write(*, '(E40.20)') huge(0.0d0)
end program WriteHuge
[/fortran]
prints to the console
[fortran]
1.797693134862316E+308
1.797693134862316E+308
0.1797693134862316+309
0.17976931348623157081+309
[/fortran]
Why there is no 'E' in the last two lines? Is something wrong with the format?
Compiler version: XE 13.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For an explicit format if the value of the exponent is 99 < |exp| < 999 then the E is omitted. (see the help re: format specifications E and D editing)
"print *" means "list directed format" (basically the compiler can choose the format)
Les
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For an explicit format if the value of the exponent is 99 < |exp| < 999 then the E is omitted. (see the help re: format specifications E and D editing)
"print *" means "list directed format" (basically the compiler can choose the format)
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In order to see the E field when a 3-digit exponent appears, you must specify explicitly a wider exponent field. The default was set up so that 3-digit exponents would not consume more space in formats set up for 2-digit exponent values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page