diff --git a/include/nmtools/array/view/tril.hpp b/include/nmtools/array/view/tril.hpp index b60e42a65..670b68f90 100644 --- a/include/nmtools/array/view/tril.hpp +++ b/include/nmtools/array/view/tril.hpp @@ -66,7 +66,7 @@ namespace nmtools::index nm_index_t index_0 = at(indices,meta::ct_v<-2>); nm_index_t index_1 = at(indices,meta::ct_v<-1>); - if (index_1 > (index_0 + k)) { + if ((nm_index_t)index_1 > nm_index_t(index_0 + k)) { return return_t{meta::Nothing}; } else { return return_t{result}; diff --git a/include/nmtools/array/view/triu.hpp b/include/nmtools/array/view/triu.hpp index e073a9afe..c54407d49 100644 --- a/include/nmtools/array/view/triu.hpp +++ b/include/nmtools/array/view/triu.hpp @@ -66,7 +66,7 @@ namespace nmtools::index nm_index_t index_0 = at(indices,meta::ct_v<-2>); nm_index_t index_1 = at(indices,meta::ct_v<-1>); - if (index_0 > (index_1 - k)) { + if ((nm_index_t)index_0 > nm_index_t(index_1 - k)) { return return_t{meta::Nothing}; } else { return return_t{result};