- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I just came across this unique way that CVF6.6B handles output of numbers with large exponents, when using "D" Formatting. Note the way "D" is dropped in the output.
Is this to standard, or a bug? Is there a complier switch that will fix?
Greg
Produces this output:
I just came across this unique way that CVF6.6B handles output of numbers with large exponents, when using "D" Formatting. Note the way "D" is dropped in the output.
Is this to standard, or a bug? Is there a complier switch that will fix?
Greg
real xval, rval*8 rval=1.2342342323423d+28 write(*,'(1P,D20.13)')rval write(*,'(1P,D20.13)')HUGE(rval) rval=1.2342342323423d-28 write(*,'(1P,D20.13)')rval write(*,'(1P,D20.13)')TINY(rval) xval=1.2 write(*,'(1P,E20.13)')HUGE(xval) END
Produces this output:
1.2342342323423D+28 1.7976931348623+308 1.2342342323423D-28 2.2250738585072-308 3.4028234663853E+38
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is the way the Fortran standard has required it be done for many years, although a few compilers waited until around 1990 to implement it. I think the committee members agreed that the number of characters required for the exponent should not vary with magnitude.
Your other options include a format descriptor like E20.13E4, which requires the E to appear.
Your other options include a format descriptor like E20.13E4, which requires the E to appear.
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