Skip to content

Instantly share code, notes, and snippets.

@cglosser
Last active December 28, 2015 15:13
Show Gist options
  • Save cglosser/0b436464ce876a2ed57e to your computer and use it in GitHub Desktop.
Save cglosser/0b436464ce876a2ed57e to your computer and use it in GitHub Desktop.
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