-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2ab020
commit 744705f
Showing
4 changed files
with
229 additions
and
118 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
module inf_values_mod | ||
|
||
use, intrinsic :: ieee_arithmetic, only : ieee_value, ieee_negative_inf, ieee_positive_inf | ||
use, non_intrinsic :: consts_mod, only : SP, DP | ||
implicit none | ||
private | ||
public :: posinf, neginf | ||
interface posinf | ||
module procedure posinf_sp, posinf_dp | ||
end interface posinf | ||
|
||
interface neginf | ||
module procedure neginf_sp, neginf_dp | ||
end interface neginf | ||
|
||
contains | ||
|
||
pure function posinf_sp(x) result(y) | ||
use, non_intrinsic :: consts_mod, only : SP | ||
implicit none | ||
real(SP), intent(in) :: x | ||
real(SP) :: y | ||
y = ieee_value(x, ieee_positive_inf) | ||
end function posinf_sp | ||
|
||
pure function posinf_dp(x) result(y) | ||
use, non_intrinsic :: consts_mod, only : DP | ||
implicit none | ||
real(DP), intent(in) :: x | ||
real(DP) :: y | ||
y = ieee_value(x, ieee_positive_inf) | ||
end function posinf_dp | ||
|
||
|
||
pure function neginf_sp(x) result(y) | ||
use, non_intrinsic :: consts_mod, only : SP | ||
implicit none | ||
real(SP), intent(in) :: x | ||
real(SP) :: y | ||
y = ieee_value(x, ieee_negative_inf) | ||
end function neginf_sp | ||
|
||
pure function neginf_dp(x) result(y) | ||
use, non_intrinsic :: consts_mod, only : DP | ||
implicit none | ||
real(DP), intent(in) :: x | ||
real(DP) :: y | ||
y = ieee_value(x, ieee_negative_inf) | ||
end function neginf_dp | ||
|
||
|
||
end module inf_values_mod |
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
Oops, something went wrong.