Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module str2num and related tests #789

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/stdlib_str2num.fypp
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@ module stdlib_str2num
integer(int8) :: err
!----------------------------------------------
call to_num_base(s,v,p,err)
p = min( p , len(s) )
p = min( p , len(s, kind = int8) )
s => s(p:)
if(present(stat)) stat = err
end function
8 changes: 4 additions & 4 deletions test/string/test_string_to_number.fypp
Original file line number Diff line number Diff line change
@@ -122,10 +122,10 @@ contains
#:elif k1 == "qp"
if(abs(rel_err) > 200*epsilon(0.0_wp)) then
#:endif
write(*,"('formatted read : ' g0)") formatted_read_out
write(*,"('to_num : ' g0)") to_num_out
write(*,"('difference abs : ' g0)") abs_err
write(*,"('difference rel : ' g0 '%')") rel_err * 100
write(*,"('formatted read : ', g0)") formatted_read_out
write(*,"('to_num : ', g0)") to_num_out
write(*,"('difference abs : ', g0)") abs_err
write(*,"('difference rel : ', g0, '%')") rel_err * 100
ucheck = .false.
end if
end function