@@ -11,7 +11,7 @@ module stdlib_experimental_default
11
11
! ! For additional clarity, `default` be called with keyword argument
12
12
! ! for the fallback value, e.g., `default(x, to=1.0)`.
13
13
! !
14
- use iso_fortran_env, only: sp = > real32, dp = > real64, qp = > real128, int16, int32, int64
14
+ use iso_fortran_env, only: sp = > real32, dp = > real64, qp = > real128, int8, int16, int32, int64
15
15
implicit none
16
16
17
17
@@ -23,6 +23,7 @@ module stdlib_experimental_default
23
23
module procedure default_sp
24
24
module procedure default_dp
25
25
module procedure default_qp
26
+ module procedure default_int8
26
27
module procedure default_int16
27
28
module procedure default_int32
28
29
module procedure default_int64
@@ -75,6 +76,19 @@ function default_qp(x, to) result(y)
75
76
end function default_qp
76
77
77
78
79
+ function default_int8 (x , to ) result(y)
80
+ integer (int8), intent (in ), optional :: x
81
+ integer (int8), intent (in ) :: to
82
+ integer (int8) :: y
83
+
84
+ if (present (x)) then
85
+ y = x
86
+ else
87
+ y = to
88
+ end if
89
+ end function default_int8
90
+
91
+
78
92
function default_int16 (x , to ) result(y)
79
93
integer (int16), intent (in ), optional :: x
80
94
integer (int16), intent (in ) :: to
0 commit comments