diff --git a/lib/node_modules/@stdlib/math/base/special/cinv/README.md b/lib/node_modules/@stdlib/math/base/special/cinv/README.md index 721d12368c83..5e7f146725e3 100644 --- a/lib/node_modules/@stdlib/math/base/special/cinv/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cinv/README.md @@ -216,7 +216,7 @@ stdlib_complex128_t stdlib_base_cinv( const stdlib_complex128_t z ); #include "stdlib/complex/float64/reim.h" #include -int main() { +int main( void ) { const stdlib_complex128_t x[] = { stdlib_complex128( 3.14, 1.5 ), stdlib_complex128( -3.14, -1.5 ), diff --git a/lib/node_modules/@stdlib/math/base/special/cinvf/README.md b/lib/node_modules/@stdlib/math/base/special/cinvf/README.md index 39b6e38dbc26..9295f72c5a8d 100644 --- a/lib/node_modules/@stdlib/math/base/special/cinvf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cinvf/README.md @@ -128,7 +128,9 @@ var logEachMap = require( '@stdlib/console/log-each-map' ); var cinvf = require( '@stdlib/math/base/special/cinvf' ); // Create an array of random numbers: -var arr = new Complex64Array( uniform( 200, -100.0, 100.0 ) ); +var arr = new Complex64Array( uniform( 200, -100.0, 100.0, { + 'dtype': 'float32' +})); // Compute the inverse of each number in the array: logEachMap( '1.0 / (%s) = %s', arr, cinvf ); diff --git a/lib/node_modules/@stdlib/ndarray/from-arraybuffer/README.md b/lib/node_modules/@stdlib/ndarray/from-arraybuffer/README.md index d27ebaa2dbfb..fbe3ee8948a4 100644 --- a/lib/node_modules/@stdlib/ndarray/from-arraybuffer/README.md +++ b/lib/node_modules/@stdlib/ndarray/from-arraybuffer/README.md @@ -187,9 +187,7 @@ v = arr.get( 1, 2, 1, 2 ); [@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/dtypes -[@stdlib/ndarray/orders]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/orders - -[@stdlib/ndarray/index-modes]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/index-modes +[@stdlib/array/buffer]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/buffer diff --git a/lib/node_modules/@stdlib/ndarray/from-arraybuffer/lib/main.js b/lib/node_modules/@stdlib/ndarray/from-arraybuffer/lib/main.js index e531b5f8cd85..10dc3849f600 100644 --- a/lib/node_modules/@stdlib/ndarray/from-arraybuffer/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/from-arraybuffer/lib/main.js @@ -141,6 +141,7 @@ function arraybuffer2ndarray( dtype, buffer, shape, strides, byteOffset, order, var ndims; var buf; var idx; + var len; var N; if ( !isDataType( dtype ) ) { @@ -179,7 +180,8 @@ function arraybuffer2ndarray( dtype, buffer, shape, strides, byteOffset, order, // Compute the number of underlying elements across which the ndarray view will span: offset = strides2offset( shape, strides ); idx = minmaxViewBufferIndex( shape, strides, offset ); - N = idx[ 1 ] - idx[ 0 ] + 1; + len = numel( shape ); + N = ( len === 0 ) ? 0 : idx[ 1 ] - idx[ 0 ] + 1; // Create the underlying ndarray buffer: if ( isBinaryDataType( dtype ) ) { @@ -189,7 +191,7 @@ function arraybuffer2ndarray( dtype, buffer, shape, strides, byteOffset, order, } else { buf = typedarray( buffer, byteOffset, N, dtype ); } - if ( ndims > 0 && !isBufferLengthCompatible( buf.length, shape, strides, offset ) && numel( shape ) > 0 ) { // eslint-disable-line max-len + if ( ndims > 0 && len > 0 && !isBufferLengthCompatible( buf.length, shape, strides, offset ) ) { // eslint-disable-line max-len throw new Error( 'invalid arguments. Input buffer is incompatible with the specified meta data. Ensure that the offset is valid with regard to the strides array and that the buffer has enough elements to satisfy the desired array shape.' ); } // Return a new ndarray instance: