Skip to content

Commit 3529123

Browse files
author
Matthias Fabry
committed
[ci optional] change safe_logs to test for FINITE IEEE values rather than NORMAL
1 parent 52fea84 commit 3529123

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

math/public/math_lib_crmath.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ elemental function safe_log_ (x) result (log_x)
153153
real(dp), intent(in) :: x
154154
real(dp) :: log_x
155155

156-
if (.NOT. IEEE_IS_NORMAL(x)) then
156+
if (.NOT. IEEE_IS_FINITE(x)) then
157157

158158
log_x = 1.E-99_dp
159159

@@ -172,7 +172,7 @@ elemental function safe_log10_ (x) result (log10_x)
172172
real(dp), intent(in) :: x
173173
real(dp) :: log10_x
174174

175-
if (.NOT. IEEE_IS_NORMAL(x)) then
175+
if (.NOT. IEEE_IS_FINITE(x)) then
176176

177177
log10_x = 1.E-99_dp
178178

math/public/math_lib_intrinsic.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ elemental function safe_log_ (x) result (log_x)
171171
real(dp), intent(in) :: x
172172
real(dp) :: log_x
173173

174-
if (.NOT. IEEE_IS_NORMAL(x)) then
174+
if (.NOT. IEEE_IS_FINITE(x)) then
175175

176176
log_x = 1.E-99_dp
177177

@@ -190,7 +190,7 @@ elemental function safe_log10_ (x) result (log10_x)
190190
real(dp), intent(in) :: x
191191
real(dp) :: log10_x
192192

193-
if (.NOT. IEEE_IS_NORMAL(x)) then
193+
if (.NOT. IEEE_IS_FINITE(x)) then
194194

195195
log10_x = 1.E-99_dp
196196

0 commit comments

Comments
 (0)