22
22
!> difference rel : 0.3300E-029%
23
23
24
24
module stdlib_str2num
25
- use iso_fortran_env , only: sp => real32 , dp => real64 , qp => real128
25
+ use stdlib_kinds , only: sp, dp, qp, int8, int32
26
26
use ieee_arithmetic
27
27
implicit none
28
28
private
@@ -46,21 +46,27 @@ module stdlib_str2num
46
46
module procedure to_int
47
47
module procedure to_float
48
48
module procedure to_double
49
+ #:if WITH_QP
49
50
module procedure to_quad
51
+ #:endif
50
52
end interface
51
53
52
54
interface to_num_p
53
55
module procedure to_int_p
54
56
module procedure to_float_p
55
57
module procedure to_double_p
58
+ #:if WITH_QP
56
59
module procedure to_quad_p
60
+ #:endif
57
61
end interface
58
62
59
63
interface to_num_base
60
64
module procedure to_int_32
61
65
module procedure to_real_sp
62
66
module procedure to_real_dp
67
+ #:if WITH_QP
63
68
module procedure to_real_qp
69
+ #:endif
64
70
end interface
65
71
66
72
contains
@@ -153,6 +159,7 @@ module stdlib_str2num
153
159
if(present(stat)) stat = err
154
160
end function
155
161
162
+ #:if WITH_QP
156
163
function to_quad(s,mold) result(r)
157
164
! -- In/out Variables
158
165
character(*), intent(in) :: s !> input string
@@ -180,6 +187,7 @@ module stdlib_str2num
180
187
s => s(p:)
181
188
if(present(stat)) stat = err
182
189
end function
190
+ #:endif
183
191
184
192
!---------------------------------------------
185
193
! String To Number Implementations
@@ -400,6 +408,7 @@ module stdlib_str2num
400
408
stat = 0
401
409
end subroutine
402
410
411
+ #:if WITH_QP
403
412
subroutine to_real_qp(s,v,p,stat)
404
413
integer, parameter :: wp = qp
405
414
!> Sequentially unroll the character and get the sub integers composing the whole number, fraction and exponent
@@ -502,6 +511,7 @@ module stdlib_str2num
502
511
end if
503
512
stat = 0
504
513
end subroutine
514
+ #:endif
505
515
506
516
!---------------------------------------------
507
517
! Internal Utility functions
@@ -529,4 +539,4 @@ module stdlib_str2num
529
539
end do
530
540
end function
531
541
532
- end module stdlib_str2num
542
+ end module stdlib_str2num
0 commit comments