Skip to content

Commit fff5372

Browse files
Merge pull request #545 from amanotk/master
Fixed an issue when IEEE floating-point rounding mode is IEEE_DOWN
2 parents c80ef5e + e4bfffc commit fff5372

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/json_string_utilities.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ subroutine string_to_integer(str,ival,status_ok)
127127
! Compute how many digits we need to read
128128
ndigits = 2*len_trim(str)
129129
if (ndigits/=0) then
130-
ndigits_digits = floor(log10(real(ndigits)))+1
130+
ndigits_digits = nint(log10(real(ndigits)))+1
131131
allocate(character(kind=CDK,len=ndigits_digits) :: digits)
132132
write(digits,'(I0)') ndigits !gfortran will have a runtime error with * edit descriptor here
133133
! gfortran bug: '*' edit descriptor for ISO_10646 strings does bad stuff.

0 commit comments

Comments
 (0)