We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee33055 commit 99afeebCopy full SHA for 99afeeb
1 file changed
src/math/stdlib_math_diff.fypp
@@ -85,8 +85,20 @@ contains
85
dim_ = 1
86
end if
87
88
- if (present(prepend)) size_prepend = size(prepend, dim_)
89
- if (present(append)) size_append = size(append, dim_)
+ if (present(prepend)) then
+ if (size(prepend, 3 - dim_) /= size(x, 3 - dim_)) then
90
+ error stop "stdlib_math_diff: non-differencing dimension of 'prepend' must match 'x'"
91
+ end if
92
+ size_prepend = size(prepend, dim_)
93
94
+
95
+ if (present(append)) then
96
+ if (size(append, 3 - dim_) /= size(x, 3 - dim_)) then
97
+ error stop "stdlib_math_diff: non-differencing dimension of 'append' must match 'x'"
98
99
+ size_append = size(append, dim_)
100
101
102
size_x = size(x, dim_)
103
size_work = size_x + size_prepend + size_append
104
0 commit comments