Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Integer read/write ponderable

$
0
0

Suppose you have an 5-digit integer variable and read into it the following:  03928

Immediately after the read, the variable appears to contain '3928'.

Later, this same variable is written out via format i5, and it appears as '_3928' (the leading zero has disappeared).

If the original value is replaced by '13028', it reads and writes exactly as expected, i.e., all 5 digits are preserved.

If I handled this as a character, I could manage this issue. But handling it as an integer, why does the compiler appear to swallow the leading zero in the 5-digit integer?  Is there an easy way to preserve it?


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>