-
#include "tensorstore/util/extents.h" -
template <typename T, ptrdiff_t Extent>
T tensorstore::ProductOfExtents(span<T, Extent> s); Computes the product of the elements of the given span.
- Parameters:¶
- Dchecks:¶
All elements of
sare non-negative.- Returns:¶
s[0] * ... * s[s.size()-1], or1ifs.empty(), orstd::numeric_limits<T>::max()if integer overflow occurs. However, if any element is0, the return value is guaranteed to be0, even if overflow occurred in computing an intermediate product.