![]() The same holds to floating point numbers in the exponential form 0.12345678901234567890E0 Is a default (single) precision floating literal, no matter where does it appear. ![]() There are several questions linking here so it is good to state some details more explicitly with examples, especially for beginners.Īs stated by MRAB in his correct answer, an expression is always evaluated without any context, so 0.12345678901234567890 Is there a better way to assign double precision variables, or do I have to explicitly type them as above? ![]() This seems odd, as I would expect (I'm relatively new to Fortran) that a double precision variable would automatically be double-precision. The single precision result starts rounding off at the 8th decimal as expected, but only the double precision variable I assigned explicitly with _dp keeps all 16 digits of precision. ![]() In Fortran 90 (using gfortran on Mac OS X) if I assign a value to a double-precision variable without explicitly tacking on a kind, the precision doesn't "take." What I mean is, if I run the following program: program sample_dp ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |