diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlast-index-of-falsy/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlast-index-of-falsy/lib/main.js index 544badd36a48..1d477057cc1b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlast-index-of-falsy/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlast-index-of-falsy/lib/main.js @@ -25,7 +25,7 @@ var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); var getStride = require( '@stdlib/ndarray/base/stride' ); var getOffset = require( '@stdlib/ndarray/base/offset' ); var getData = require( '@stdlib/ndarray/base/data-buffer' ); -var clipIndex = require( '@stdlib/ndarray/base/clip-index' ); +var clipUpperIndex = require( '@stdlib/ndarray/base/clip-upper-index' ); var strided = require( '@stdlib/blas/ext/base/dlast-index-of-falsy' ).ndarray; @@ -66,9 +66,9 @@ function dlastIndexOfFalsy( arrays ) { fromIndex = ndarraylike2scalar( arrays[ 1 ] ); N = numelDimension( x, 0 ); - fromIndex = clipIndex( fromIndex, N ); - if ( fromIndex >= N ) { - fromIndex = N - 1; + fromIndex = clipUpperIndex( fromIndex, ( fromIndex < 0 ) ? N : N-1 ); + if ( fromIndex < 0 ) { + return -1; } return strided( fromIndex+1, getData( x ), getStride( x, 0 ), getOffset( x ) ); } diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlast-index-of-falsy/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlast-index-of-falsy/test/test.js index d766708cc936..d481e9d9f361 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlast-index-of-falsy/test/test.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dlast-index-of-falsy/test/test.js @@ -170,7 +170,7 @@ tape( 'the function supports a `fromIndex` parameter (negative)', function test( 'dtype': 'generic' }); actual = dlastIndexOfFalsy( [ x, fromIndex ] ); - t.strictEqual( actual, 0, 'returns expected value' ); + t.strictEqual( actual, -1, 'returns expected value' ); t.end(); });