We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2010916 commit a504100Copy full SHA for a504100
lib/node_modules/@stdlib/ndarray/base/wrap-index/src/main.c
@@ -33,7 +33,7 @@
33
* // returns 2
34
*/
35
int64_t stdlib_ndarray_wrap_index( int64_t idx, int64_t max ) {
36
- uint64_t mp1 = max + 1; // `uint64_t` to guard against overflow
+ int64_t mp1 = max + 1; // WARNING: possibility of overflow (although, in practice, `max` should never be that large)
37
if ( idx < 0 ) {
38
idx += mp1; // slight optimization to avoid modulo arithmetic when |idx| <= max+1
39
0 commit comments