Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
stdlib-bot committed Dec 18, 2023
1 parent 3f13142 commit 0f6c70a
Showing 3 changed files with 89 additions and 89 deletions.
170 changes: 85 additions & 85 deletions complex64/README.md
Original file line number Diff line number Diff line change
@@ -514,6 +514,56 @@ len = arr.length;
// returns 2
```

<a name="method-at"></a>

#### Complex64Array.prototype.at( i )

Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer positions.

```javascript
var realf = require( '@stdlib/complex/realf' );
var imagf = require( '@stdlib/complex/imagf' );

var arr = new Complex64Array( 10 );

// Set the first, second, and last elements:
arr.set( [ 1.0, -1.0 ], 0 );
arr.set( [ 2.0, -2.0 ], 1 );
arr.set( [ 9.0, -9.0 ], 9 );

// Get the first element:
var z = arr.at( 0 );
// returns <Complex64>

var re = realf( z );
// returns 1.0

var im = imagf( z );
// returns -1.0

// Get the last element:
z = arr.at( -1 );
// returns <Complex64>

re = realf( z );
// returns 9.0

im = imagf( z );
// returns -9.0
```

If provided an out-of-bounds index, the method returns `undefined`.

```javascript
var arr = new Complex64Array( 10 );

var z = arr.at( 100 );
// returns undefined

z = arr.at( -100 );
// returns undefined
```

<a name="method-copy-within"></a>

#### Complex64Array.prototype.copyWithin( target, start\[, end] )
@@ -748,91 +798,6 @@ var bool = it.next().done;
// returns true
```

<a name="method-get"></a>

#### Complex64Array.prototype.get( i )

Returns an array element located at a nonnegative integer position (index) `i`.

```javascript
var realf = require( '@stdlib/complex/realf' );
var imagf = require( '@stdlib/complex/imagf' );

var arr = new Complex64Array( 10 );

// Set the first element:
arr.set( [ 1.0, -1.0 ], 0 );

// Get the first element:
var z = arr.get( 0 );
// returns <Complex64>

var re = realf( z );
// returns 1.0

var im = imagf( z );
// returns -1.0
```

If provided an out-of-bounds index, the method returns `undefined`.

```javascript
var arr = new Complex64Array( 10 );

var z = arr.get( 100 );
// returns undefined
```

<a name="method-at"></a>

#### Complex64Array.prototype.at( i )

Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer positions.

```javascript
var realf = require( '@stdlib/complex/realf' );
var imagf = require( '@stdlib/complex/imagf' );

var arr = new Complex64Array( 10 );

// Set the first, second, and last elements:
arr.set( [ 1.0, -1.0 ], 0 );
arr.set( [ 2.0, -2.0 ], 1 );
arr.set( [ 9.0, -9.0 ], 9 );

// Get the first element:
var z = arr.at( 0 );
// returns <Complex64>

var re = realf( z );
// returns 1.0

var im = imagf( z );
// returns -1.0

// Get the last element:
z = arr.at( -1 );
// returns <Complex64>

re = realf( z );
// returns 9.0

im = imagf( z );
// returns -9.0
```

If provided an out-of-bounds index, the method returns `undefined`.

```javascript
var arr = new Complex64Array( 10 );

var z = arr.at( 100 );
// returns undefined

z = arr.at( -100 );
// returns undefined
```

<a name="method-every"></a>

#### Complex64Array.prototype.every( predicate\[, thisArg] )
@@ -891,6 +856,41 @@ var count = context.count;
// returns 3
```

<a name="method-get"></a>

#### Complex64Array.prototype.get( i )

Returns an array element located at a nonnegative integer position (index) `i`.

```javascript
var realf = require( '@stdlib/complex/realf' );
var imagf = require( '@stdlib/complex/imagf' );

var arr = new Complex64Array( 10 );

// Set the first element:
arr.set( [ 1.0, -1.0 ], 0 );

// Get the first element:
var z = arr.get( 0 );
// returns <Complex64>

var re = realf( z );
// returns 1.0

var im = imagf( z );
// returns -1.0
```

If provided an out-of-bounds index, the method returns `undefined`.

```javascript
var arr = new Complex64Array( 10 );

var z = arr.get( 100 );
// returns undefined
```

<a name="method-set"></a>

#### Complex64Array.prototype.set( z\[, i] )
6 changes: 3 additions & 3 deletions complex64/lib/main.js
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ var HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a complex typed array
*/
function isComplexArray( value ) { // TODO: move to array/base/assert/is-complex-array
function isComplexArray( value ) {
return (
value instanceof Complex64Array ||
(
@@ -737,10 +737,10 @@ setReadOnly( Complex64Array.prototype, 'BYTES_PER_ELEMENT', Complex64Array.BYTES
* var z = arr.get( 3 );
*
* var re = realf( z );
* // returns 2
* // returns 2.0
*
* var im = imagf( z );
* // returns 2
* // returns 2.0
*/
setReadOnly( Complex64Array.prototype, 'copyWithin', function copyWithin( target, start ) {
if ( !isComplexArray( this ) ) {
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit 0f6c70a

Please sign in to comment.