Last active
December 28, 2015 15:13
-
-
Save cglosser/0b436464ce876a2ed57e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program test | |
use ISO_FORTRAN_ENV | |
implicit none | |
real(kind=real64) :: x | |
call random_number(x) ! make sure x has been filled with "random" bits | |
write(*,*) x | |
x = 0.9 ! Single precision assignment | |
write(*,*) x !prints 0.89999997615814209 | |
x = 0.9d0 !Double precision assignment | |
write(*,*) x !prints 0.90000000000000002 | |
end program test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment