Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Small number format

ferrad01
Beginner
731 Views
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.


0 Kudos
3 Replies
ferrad01
Beginner
731 Views
Actually if I read with D22.12 it reads OK, my read format statement was old. But it is rather strange.
0 Kudos
Steven_L_Intel1
Employee
731 Views
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.
0 Kudos
jimdempseyatthecove
Honored Contributor III
731 Views
>>Yes, you must give up on D for the exponent letter. Fortran will read that string, but other languages may not.

Like Excel
0 Kudos
Reply