Created
April 14, 2017 05:37
-
-
Save komasaru/90ffd4f915744e9c520619342a0d2011 to your computer and use it in GitHub Desktop.
Fortran code to specify floating-point numbers.
This file contains 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
!**************************************************** | |
! 単精度・倍精度浮動小数点数の確認 | |
! | |
! date name version | |
! 2017.04.10 mk-mode.com 1.00 新規作成 | |
! | |
! Copyright(C) 2017 mk-mode.com All Rights Reserved. | |
!**************************************************** | |
! | |
program double_precision_real | |
implicit none | |
integer, parameter :: SP = kind(1.0) | |
integer, parameter :: DP = selected_real_kind(2*precision(1.0_SP)) | |
real(SP) :: a | |
real(DP) :: b | |
a = 3.1415926535897323846264338327950288_SP | |
b = 3.1415926535897323846264338327950288_DP | |
print *,' a, b = ', a, b | |
end program double_precision_real |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment