@@ -77,7 +77,7 @@ var Float32Array = require( '@stdlib/array/float32' );
7777
7878var x = new Float32Array ( [ 1.0 , 2.0 , 2.0 , - 7.0 , - 2.0 , 3.0 , 4.0 , 2.0 ] );
7979
80- var v = dsmeanors ( 5 , x, 2 );
80+ var v = dsmeanors ( 4 , x, 2 );
8181// returns 1.25
8282```
8383
@@ -91,7 +91,7 @@ var Float32Array = require( '@stdlib/array/float32' );
9191var x0 = new Float32Array ( [ 2.0 , 1.0 , 2.0 , - 2.0 , - 2.0 , 2.0 , 3.0 , 4.0 ] );
9292var x1 = new Float32Array ( x0 .buffer , x0 .BYTES_PER_ELEMENT * 1 ); // start at 2nd element
9393
94- var v = dsmeanors ( 5 , x1, 2 );
94+ var v = dsmeanors ( 4 , x1, 2 );
9595// returns 1.25
9696```
9797
@@ -119,7 +119,7 @@ var Float32Array = require( '@stdlib/array/float32' );
119119
120120var x = new Float32Array ( [ 2.0 , 1.0 , 2.0 , - 2.0 , - 2.0 , 2.0 , 3.0 , 4.0 ] );
121121
122- var v = dsmeanors .ndarray ( 5 , x, 2 , 1 );
122+ var v = dsmeanors .ndarray ( 4 , x, 2 , 1 );
123123// returns 1.25
124124```
125125
@@ -180,39 +180,44 @@ console.log( v );
180180
181181#### stdlib_strided_dsmeanors( N, \* X, strideX )
182182
183- Calculate the maximum value of a double -precision floating-point strided array, ignoring ` NaN ` values.
183+ Calculate the mean value of a single -precision floating-point strided array, ignoring ` NaN ` values.
184184
185185``` c
186186const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
187187
188- flaot v = stdlib_strided_dsmeanors( 5 , x, 2 );
189- // returns 7.0
188+ float v = stdlib_strided_dsmeanors( 4 , x, 2 );
189+ // returns 1.25
190190```
191+
191192The function accepts the following arguments:
193+
192194- **N**: `[in] CBLAS_INT` number of indexed elements.
193- - **X**: `[in] double *` input array.
195+ - **X**: `[in] float *` input array.
194196- **strideX**: `[in] CBLAS_INT` stride length for `X`.
197+
195198```c
196- double stdlib_strided_dnanmax ( const CBLAS_INT N, const double *X, const CBLAS_INT strideX );
199+ float stdlib_strided_dsmeanors ( const CBLAS_INT N, const float *X, const CBLAS_INT strideX );
197200```
198201
199- #### stdlib_strided_dnanmax_ndarray ( N, \* X, strideX, offsetX )
202+ #### stdlib_strided_dsmeanors_ndarray ( N, \* X, strideX, offsetX )
200203
201- Computes the maximum value of a double -precision floating-point strided array, ignoring ` NaN ` values and using alternative indexing semantics.
204+ Computes the mean value of a single -precision floating-point strided array, ignoring ` NaN ` values and using alternative indexing semantics.
202205
203206``` c
204- const double x[] = { 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0, 0.0/0.0, 0.0/0.0 };
207+ const float x[] = { 1.0f , 2.0f , 3.0f , 4.0f , 5.0f , 6.0f , 7.0f , 8.0f };
205208
206- double v = stdlib_strided_dnanmax_ndarray( 5 , x, 2, 0 );
207- // returns 7.0
209+ float v = stdlib_strided_dsmeanors_ndarray( 4 , x, 2, 0 );
210+ // returns 1.25
208211```
209212The function accepts the following arguments:
213+
210214- **N**: `[in] CBLAS_INT` number of indexed elements.
211- - **X**: `[in] double *` input array.
215+ - **X**: `[in] float *` input array.
212216- **strideX**: `[in] CBLAS_INT` stride length for `X`.
213217- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
218+
214219```c
215- double stdlib_strided_dnanmax_ndarray ( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
220+ double stdlib_strided_dsmeanors_ndarray ( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
216221```
217222
218223</section >
@@ -234,25 +239,25 @@ double stdlib_strided_dnanmax_ndarray( const CBLAS_INT N, const double *X, const
234239### Examples
235240
236241``` c
237- #include " stdlib/stats/base/dnanmax .h"
242+ #include " stdlib/stats/base/dsmeanors .h"
238243#include < stdint.h>
239244#include < stdio.h>
240245
241246int main ( void ) {
242247 // Create a strided array:
243- const double x[ ] = { 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0, 0.0/0.0, 0.0/0.0 };
248+ const float x[ ] = { 1.0f , 2.0f , 3.0f , 4.0f , 5.0f , 6.0f , 7.0f , 8.0f };
244249
245250 // Specify the number of elements:
246- const int N = 5 ;
251+ const int N = 4 ;
247252
248253 // Specify the stride length:
249254 const int strideX = 2;
250255
251- // Compute the maximum value :
252- double v = stdlib_strided_dnanmax ( N, x, strideX );
256+ // Compute the arithmetic mean :
257+ float v = stdlib_strided_dsmeanors ( N, x, strideX );
253258
254259 // Print the result:
255- printf( "max : %lf\n", v );
260+ printf( "mean : %lf\n", v );
256261}
257262```
258263
0 commit comments