Skip to content

Commit ab2d094

Browse files
authored
Update main.js
Signed-off-by: Kaushikgtm <[email protected]>
1 parent 1d4d0fa commit ab2d094

File tree

1 file changed

+20
-4
lines changed
  • lib/node_modules/@stdlib/stats/base/nanminabs/lib

1 file changed

+20
-4
lines changed

lib/node_modules/@stdlib/stats/base/nanminabs/lib/main.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2020 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -20,15 +20,31 @@
2020

2121
// MODULES //
2222

23-
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
2423
var nanminabs = require( './nanminabs.js' );
2524
var ndarray = require( './ndarray.js' );
25+
var stride2offset = require( '@stdlib/strided/base/stride2offset' );
2626

2727

2828
// MAIN //
29-
29+
/**
30+
* Computes the minimum absolute value of a strided array.
31+
*
32+
* @param {PositiveInteger} N - number of indexed elements
33+
* @param {NumericArray} x - input array
34+
* @param {integer} strideX - stride length
35+
* @returns {number} minimum absolute value
36+
*
37+
* @example
38+
* var x = [ 1.0, -2.0, 2.0 ];
39+
* var N = x.length;
40+
*
41+
* var v = min( N, x, 1 );
42+
* // returns -2.0
43+
*/
3044
setReadOnly( nanminabs, 'ndarray', ndarray );
31-
45+
function nanminabs( N, x, strideX ) {
46+
return ndarray( N, x, strideX, stride2offset( N, strideX ) );
47+
}
3248

3349
// EXPORTS //
3450

0 commit comments

Comments
 (0)