Skip to content

Commit

Permalink
docs: move methods to preserve alphabetical order
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Dec 18, 2023
1 parent 9272073 commit 5f1953d
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 88 deletions.
170 changes: 85 additions & 85 deletions lib/node_modules/@stdlib/array/complex64/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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] )
Expand Down Expand Up @@ -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] )
Expand Down Expand Up @@ -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] )
Expand Down
6 changes: 3 additions & 3 deletions lib/node_modules/@stdlib/array/complex64/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
(
Expand Down Expand Up @@ -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 ) ) {
Expand Down

1 comment on commit 5f1953d

@stdlib-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
array/complex64 $\color{red}1475/1476$
$\color{green}+99.93\%$
$\color{red}243/245$
$\color{green}+99.18\%$
$\color{green}24/24$
$\color{green}+100.00\%$
$\color{red}1475/1476$
$\color{green}+99.93\%$

The above coverage report was generated for the changes in this push.

Please sign in to comment.