<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 2 September 2016 at 00:46, Scott Kruger <span dir="ltr"><<a href="mailto:kruger@txcorp.com" target="_blank">kruger@txcorp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id="gmail-:17y" class="gmail-a3s gmail-aXjCH gmail-m156e7b8273d99023">Lisandro's description is the most natural way for a modern fortran programmer.<br>
<br>
But for completeness, this is equivalent:<br>
   x=REAL(0.12345678912345678912<wbr>3456789,KIND=PETSC_REAL_KIND)</div></blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra">I think you are wrong. The literal gets demoted to single precision, so you loose digits.</div><div class="gmail_extra"><br></div><div class="gmail_extra">$ cat tmp.f90</div><div class="gmail_extra">program main</div><div class="gmail_extra">  real(kind=8) x</div><div class="gmail_extra">  x = REAL(0.123456789123456789123456789,KIND=8)</div><div class="gmail_extra">  write (*,'(F18.16)') x</div><div class="gmail_extra">  x = 0.123456789123456789123456789_8</div><div class="gmail_extra">  write (*,'(F18.16)') x</div><div class="gmail_extra">end program main</div><div class="gmail_extra"><br></div><div class="gmail_extra">$ gfortran tmp.f90</div><div class="gmail_extra">$ ./a.out </div><div class="gmail_extra">0.1234567910432816</div><div class="gmail_extra">0.1234567891234568</div><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Lisandro Dalcin<br>============<br>Research Scientist<br>Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)<br>Extreme Computing Research Center (ECRC)<br>King Abdullah University of Science and Technology (KAUST)<br><a href="http://ecrc.kaust.edu.sa/" target="_blank">http://ecrc.kaust.edu.sa/</a><br><br>4700 King Abdullah University of Science and Technology<br>al-Khawarizmi Bldg (Bldg 1), Office # 0109<br>Thuwal 23955-6900, Kingdom of Saudi Arabia<br><a href="http://www.kaust.edu.sa" target="_blank">http://www.kaust.edu.sa</a><br><br>Office Phone: +966 12 808-0459</div>
</div></div>