Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This happens because you are using default formatting for the output.</p> <p><code>print*</code> is equivalent to <code>write(unit=*,fmt=*)</code>, where <code>fmt=*</code> means use default formatting for the output, which may be compiler dependent. Default formatting uses as much space is possibly needed by the data type being output, without making adjustments based on the value.</p> <p>Consider following code:</p> <pre><code>integer(kind=4) :: a ! short integer for my compiler integer(kind=8) :: b ! long integer for my compiler a = 23 b = huge(a) print*,a ! small value, short integer, we expect spaces print*,huge(a) ! maximum value, short integer, we expect no spaces print*,huge(b) ! maximum value, long integer, we expect no spaces print*,b ! medium lenght value, long integer, we expect spaces end </code></pre> <p>When compiler with gfortran, the output is:</p> <pre><code> 23 2147483647 9223372036854775807 2147483647 </code></pre> <p>The first line is a small number in 4-byte integer representation. Notice the spaces to fill up to the maximum possible size. Second line is the largest value a 4-byte integer can take. Fits tightly in output, no spaces. Third line is the largest value of an 8-byte integer. Fits tightly. The fourth line is the same value from the 2nd line, but in 8-byte integer representation. Notice the spaces.</p> <p>This answers why you get spaces in output for default formatting. It does not quite answer your question exactly, which is why there are no spaces in output for a quad-precision integer. I don't know. Neither of my compilers (<code>pgf90 10.6-0</code>, <code>ifort 12.0.2.137</code>, <code>gfortran 4.5.1</code>) support quad-precision integer. Could be a compiler hackery. Someone might have more experience with this part, and hopefully they will chime in.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload