{"id":15011274,"url":"https://github.com/stdlib-js/array-complex64","last_synced_at":"2025-04-09T19:06:02.187Z","repository":{"id":41433937,"uuid":"377258139","full_name":"stdlib-js/array-complex64","owner":"stdlib-js","description":"Complex64Array.","archived":false,"fork":false,"pushed_at":"2025-03-24T01:43:14.000Z","size":3019,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T19:05:54.530Z","etag":null,"topics":["array","cmplx","complex","complex64","complex64array","data","float","imag","imaginary","javascript","node","node-js","nodejs","real","stdlib","structure","typed","typed-array","types"],"latest_commit_sha":null,"homepage":"https://github.com/stdlib-js/stdlib","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stdlib-js.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["stdlib-js"],"open_collective":"stdlib","tidelift":"npm/@stdlib/stdlib"}},"created_at":"2021-06-15T18:23:53.000Z","updated_at":"2025-03-24T01:08:36.000Z","dependencies_parsed_at":"2023-02-17T02:01:47.691Z","dependency_job_id":"c6bf6f1a-2910-4cbf-a2e4-6c3a86b2f44b","html_url":"https://github.com/stdlib-js/array-complex64","commit_stats":{"total_commits":138,"total_committers":2,"mean_commits":69.0,"dds":0.007246376811594235,"last_synced_commit":"3c641a9bf9b74630d399097415eb8148d4a7adeb"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdlib-js%2Farray-complex64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdlib-js%2Farray-complex64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdlib-js%2Farray-complex64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdlib-js%2Farray-complex64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stdlib-js","download_url":"https://codeload.github.com/stdlib-js/array-complex64/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094994,"owners_count":21046770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","cmplx","complex","complex64","complex64array","data","float","imag","imaginary","javascript","node","node-js","nodejs","real","stdlib","structure","typed","typed-array","types"],"created_at":"2024-09-24T19:40:06.122Z","updated_at":"2025-04-09T19:06:02.172Z","avatar_url":"https://github.com/stdlib-js.png","language":"JavaScript","readme":"\u003c!--\n\n@license Apache-2.0\n\nCopyright (c) 2018 The Stdlib Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n--\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    About stdlib...\n  \u003c/summary\u003e\n  \u003cp\u003eWe believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.\u003c/p\u003e\n  \u003cp\u003eThe library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.\u003c/p\u003e\n  \u003cp\u003eWhen you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.\u003c/p\u003e\n  \u003cp\u003eTo join us in bringing numerical computing to the web, get started by checking us out on \u003ca href=\"https://github.com/stdlib-js/stdlib\"\u003eGitHub\u003c/a\u003e, and please consider \u003ca href=\"https://opencollective.com/stdlib\"\u003efinancially supporting stdlib\u003c/a\u003e. We greatly appreciate your continued support!\u003c/p\u003e\n\u003c/details\u003e\n\n# Complex64Array\n\n[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] \u003c!-- [![dependencies][dependencies-image]][dependencies-url] --\u003e\n\n\u003e 64-bit complex number array.\n\n\u003c!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. --\u003e\n\n\u003csection class=\"intro\"\u003e\n\n\u003c/section\u003e\n\n\u003c!-- /.intro --\u003e\n\n\u003c!-- Package usage documentation. --\u003e\n\n\u003csection class=\"installation\"\u003e\n\n## Installation\n\n```bash\nnpm install @stdlib/array-complex64\n```\n\nAlternatively,\n\n-   To load the package in a website via a `script` tag without installation and bundlers, use the [ES Module][es-module] available on the [`esm`][esm-url] branch (see [README][esm-readme]).\n-   If you are using Deno, visit the [`deno`][deno-url] branch (see [README][deno-readme] for usage intructions).\n-   For use in Observable, or in browser/node environments, use the [Universal Module Definition (UMD)][umd] build available on the [`umd`][umd-url] branch (see [README][umd-readme]).\n\nThe [branches.md][branches-url] file summarizes the available branches and displays a diagram illustrating their relationships.\n\nTo view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.\n\n\u003c/section\u003e\n\n\u003csection class=\"usage\"\u003e\n\n## Usage\n\n```javascript\nvar Complex64Array = require( '@stdlib/array-complex64' );\n```\n\n\u003ca name=\"constructor\"\u003e\u003c/a\u003e\n\n#### Complex64Array()\n\nCreates a 64-bit complex number array.\n\n```javascript\nvar arr = new Complex64Array();\n// returns \u003cComplex64Array\u003e\n```\n\n#### Complex64Array( length )\n\nCreates a 64-bit complex number array having a specified `length`.\n\n```javascript\nvar arr = new Complex64Array( 10 );\n// returns \u003cComplex64Array\u003e\n\nvar len = arr.length;\n// returns 10\n```\n\n#### Complex64Array( complexarray )\n\nCreates a 64-bit complex number array from another complex number array.\n\n```javascript\nvar arr1 = new Complex64Array( [ 1.0, -1.0, 2.0, -2.0 ] ); // [ re, im, re, im ]\n// returns \u003cComplex64Array\u003e\n\nvar arr2 = new Complex64Array( arr1 );\n// returns \u003cComplex64Array\u003e\n\nvar len = arr2.length;\n// returns 2\n```\n\n#### Complex64Array( typedarray )\n\nCreates a 64-bit complex number array from a [typed array][@stdlib/array/typed] containing interleaved real and imaginary components.\n\n```javascript\nvar Float32Array = require( '@stdlib/array-float32' );\n\nvar buf = new Float32Array( [ 1.0, -1.0, 2.0, -2.0 ] ); // [ re, im, re, im ]\n// returns \u003cFloat32Array\u003e[ 1.0, -1.0, 2.0, -2.0 ]\n\nvar arr = new Complex64Array( buf );\n// returns \u003cComplex64Array\u003e\n\nvar len = arr.length;\n// returns 2\n```\n\n#### Complex64Array( obj )\n\nCreates a 64-bit complex number array from an array-like object or iterable.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\n// From an array of interleaved real and imaginary components:\nvar arr1 = new Complex64Array( [ 1.0, -1.0, 2.0, -2.0 ] );\n// returns \u003cComplex64Array\u003e\n\nvar len = arr1.length;\n// returns 2\n\n// From an array containing complex numbers:\nvar buf = [ new Complex64( 1.0, -1.0 ), new Complex64( 2.0, -2.0 ) ];\nvar arr2 = new Complex64Array( buf );\n\nlen = arr2.length;\n// returns 2\n```\n\n#### Complex64Array( buffer\\[, byteOffset\\[, length]] )\n\nReturns a 64-bit complex number array view of an [`ArrayBuffer`][@stdlib/array/buffer].\n\n```javascript\nvar ArrayBuffer = require( '@stdlib/array-buffer' );\nvar buf = new ArrayBuffer( 240 );\n\nvar arr1 = new Complex64Array( buf );\n// returns \u003cComplex64Array\u003e\n\nvar len = arr1.length;\n// returns 30\n\nvar arr2 = new Complex64Array( buf, 8 );\n// returns \u003cComplex64Array\u003e\n\nlen = arr2.length;\n// returns 29\n\nvar arr3 = new Complex64Array( buf, 8, 20 );\n// returns \u003cComplex64Array\u003e\n\nlen = arr3.length;\n// returns 20\n```\n\n* * *\n\n### Properties\n\n\u003ca name=\"static-prop-bytes-per-element\"\u003e\u003c/a\u003e\n\n#### Complex64Array.BYTES_PER_ELEMENT\n\nStatic property returning the size (in bytes) of each array element.\n\n```javascript\nvar nbytes = Complex64Array.BYTES_PER_ELEMENT;\n// returns 8\n```\n\n\u003ca name=\"static-prop-name\"\u003e\u003c/a\u003e\n\n#### Complex64Array.name\n\nStatic property returning the constructor name.\n\n```javascript\nvar str = Complex64Array.name;\n// returns 'Complex64Array'\n```\n\n\u003ca name=\"prop-buffer\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.buffer\n\nPointer to the underlying data buffer.\n\n```javascript\nvar arr = new Complex64Array( 2 );\n// returns \u003cComplex64Array\u003e\n\nvar buf = arr.buffer;\n// returns \u003cArrayBuffer\u003e\n```\n\n\u003ca name=\"prop-byte-length\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.byteLength\n\nSize (in bytes) of the array.\n\n```javascript\nvar arr = new Complex64Array( 10 );\n// returns \u003cComplex64Array\u003e\n\nvar nbytes = arr.byteLength;\n// returns 80\n```\n\n\u003ca name=\"prop-byte-offset\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.byteOffset\n\nOffset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n\n```javascript\nvar ArrayBuffer = require( '@stdlib/array-buffer' );\n\nvar arr = new Complex64Array( 10 );\n// returns \u003cComplex64Array\u003e\n\nvar offset = arr.byteOffset;\n// returns 0\n\nvar buf = new ArrayBuffer( 240 );\narr = new Complex64Array( buf, 64 );\n// returns \u003cComplex64Array\u003e\n\noffset = arr.byteOffset;\n// returns 64\n```\n\n\u003ca name=\"prop-bytes-per-element\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.BYTES_PER_ELEMENT\n\nSize (in bytes) of each array element.\n\n```javascript\nvar arr = new Complex64Array( 10 );\n// returns \u003cComplex64Array\u003e\n\nvar nbytes = arr.BYTES_PER_ELEMENT;\n// returns 8\n```\n\n\u003ca name=\"prop-length\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.length\n\nNumber of array elements.\n\n```javascript\nvar arr = new Complex64Array( 10 );\n// returns \u003cComplex64Array\u003e\n\nvar len = arr.length;\n// returns 10\n```\n\n* * *\n\n### Methods\n\n\u003ca name=\"static-method-from\"\u003e\u003c/a\u003e\n\n#### Complex64Array.from( src\\[, clbk\\[, thisArg]] )\n\nCreates a new 64-bit complex number array from an array-like object or an iterable.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\n// Create an array from interleaved real and imaginary components:\nvar arr = Complex64Array.from( [ 1.0, -1.0 ] );\n// returns \u003cComplex64Array\u003e\n\nvar len = arr.length;\n// returns 1\n\n// Create an array from an array of complex numbers:\narr = Complex64Array.from( [ new Complex64( 1.0, -1.0 ) ] );\n// returns \u003cComplex64Array\u003e\n\nlen = arr.length;\n// returns 1\n```\n\nThe iterator returned by an iterable must return either a complex number or an array-like object containing a real and imaginary component.\n\n```javascript\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' );\nvar Float32Array = require( '@stdlib/array-float32' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar iter;\nvar arr;\nvar len;\nvar re;\nvar im;\nvar z;\n\n// Define a function which returns an iterator protocol-compliant object...\nfunction iterable() {\n    var buf = new Float32Array( 2 );\n    var i = 0;\n    return {\n        'next': next\n    };\n\n    function next() {\n        i += 1;\n        if ( i \u003c 3 ) {\n            // Reuse allocated memory...\n            buf[ 0 ] = i;\n            buf[ 1 ] = -i;\n            return {\n                'value': buf\n            };\n        }\n        return {\n            'done': true\n        };\n    }\n}\n\nif ( ITERATOR_SYMBOL === null ) {\n    console.error( 'Environment does not support iterables.' );\n} else {\n    // Create an iterable:\n    iter = {};\n    iter[ ITERATOR_SYMBOL ] = iterable;\n\n    // Generate a complex number array:\n    arr = Complex64Array.from( iter );\n    // returns \u003cComplex64Array\u003e\n\n    len = arr.length;\n    // returns 2\n\n    z = arr.get( 0 );\n    // returns \u003cComplex64\u003e\n\n    re = realf( z );\n    // returns 1.0\n\n    im = imagf( z );\n    // returns -1.0\n}\n```\n\nTo invoke a function for each `src` value, provide a callback function. If `src` is an iterable or an array-like object containing complex numbers, the callback must return either a complex number\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction map( z ) {\n    return new Complex64( realf(z)*2.0, imagf(z)*2.0 );\n}\n\n// Create a source array:\nvar src = [ new Complex64( 1.0, -1.0 ) ];\n\n// Create a new complex number array by scaling the source array:\nvar arr = Complex64Array.from( src, map );\n// returns \u003cComplex64Array\u003e\n\nvar len = arr.length;\n// returns 1\n\nvar z = arr.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 2.0\n\nvar im = imagf( z );\n// returns -2.0\n```\n\nor an array-like object containing real and imaginary components\n\n```javascript\nvar Float32Array = require( '@stdlib/array-float32' );\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\n// Return a callback which reuses allocated memory...\nfunction mapFcn() {\n    var buf = new Float32Array( 2 );\n    return map;\n\n    function map( z ) {\n        buf[ 0 ] = realf( z ) * 2.0;\n        buf[ 1 ] = imagf( z ) * 2.0;\n        return buf;\n    }\n}\n\n// Create a source array:\nvar src = [ new Complex64( 1.0, -1.0 ), new Complex64( 2.0, -2.0 ) ];\n\n// Create a new complex number array by scaling the source array:\nvar arr = Complex64Array.from( src, mapFcn() );\n// returns \u003cComplex64Array\u003e\n\nvar len = arr.length;\n// returns 2\n\nvar z = arr.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 2.0\n\nvar im = imagf( z );\n// returns -2.0\n\nz = arr.get( 1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 4.0\n\nim = imagf( z );\n// returns -4.0\n```\n\nIf `src` is an array-like object containing interleaved real and imaginary components, the callback is invoked for each component and should return the transformed component value.\n\n```javascript\nvar Float32Array = require( '@stdlib/array-float32' );\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction map( v ) {\n    return v * 2.0;\n}\n\n// Create a source array:\nvar src = new Float32Array( [ 1.0, -1.0 ] );\n\n// Create a new complex number array by scaling the source array:\nvar arr = Complex64Array.from( src, map );\n// returns \u003cComplex64Array\u003e\n\nvar len = arr.length;\n// returns 1\n\nvar z = arr.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 2.0\n\nvar im = imagf( z );\n// returns -2.0\n```\n\nA callback function is provided two arguments:\n\n-   **value**: source value.\n-   **index**: source index.\n\nTo set the callback execution context, provide a `thisArg`.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction map( z ) {\n    this.count += 1;\n    return new Complex64( realf(z)*2.0, imagf(z)*2.0 );\n}\n\n// Create a source array:\nvar src = [ new Complex64( 1.0, -1.0 ), new Complex64( 1.0, -1.0 ) ];\n\n// Define an execution context:\nvar ctx = {\n    'count': 0\n};\n\n// Create a new complex number array by scaling the source array:\nvar arr = Complex64Array.from( src, map, ctx );\n// returns \u003cComplex64Array\u003e\n\nvar len = arr.length;\n// returns 2\n\nvar n = ctx.count;\n// returns 2\n```\n\n\u003ca name=\"static-method-of\"\u003e\u003c/a\u003e\n\n#### Complex64Array.of( element0\\[, element1\\[, ...elementN]] )\n\nCreates a new 64-bit complex number array from a variable number of arguments.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\nvar arr = Complex64Array.of( 1.0, -1.0, 2.0, -2.0 );\n// returns \u003cComplex64Array\u003e\n\nvar len = arr.length;\n// returns 2\n\nvar z1 = new Complex64( 1.0, -1.0 );\nvar z2 = new Complex64( 2.0, -2.0 );\n\narr = Complex64Array.of( z1, z2 );\n// returns \u003cComplex64Array\u003e\n\nlen = arr.length;\n// returns 2\n```\n\n\u003ca name=\"method-at\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.at( i )\n\nReturns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer positions.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 10 );\n\n// Set the first, second, and last elements:\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\narr.set( [ 9.0, -9.0 ], 9 );\n\n// Get the first element:\nvar z = arr.at( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 1.0\n\nvar im = imagf( z );\n// returns -1.0\n\n// Get the last element:\nz = arr.at( -1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 9.0\n\nim = imagf( z );\n// returns -9.0\n```\n\nIf provided an out-of-bounds index, the method returns `undefined`.\n\n```javascript\nvar arr = new Complex64Array( 10 );\n\nvar z = arr.at( 100 );\n// returns undefined\n\nz = arr.at( -100 );\n// returns undefined\n```\n\n\u003ca name=\"method-copy-within\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.copyWithin( target, start\\[, end] )\n\nCopies a sequence of elements within the array starting at `start` and ending at `end` (non-inclusive) to the position starting at `target`.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 4 );\n\n// Set the array elements:\narr.set( new Complex64( 1.0, -1.0 ), 0 );\narr.set( new Complex64( 2.0, -2.0 ), 1 );\narr.set( new Complex64( 3.0, -3.0 ), 2 );\narr.set( new Complex64( 4.0, -4.0 ), 3 );\n\n// Get the first array element:\nvar z = arr.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 1.0\n\nvar im = imagf( z );\n// returns -1.0\n\n// Get the second array element:\nz = arr.get( 1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 2.0\n\nim = imagf( z );\n// returns -2.0\n\n// Copy the last two elements to the first two elements:\narr.copyWithin( 0, 2 );\n\n// Get the first array element:\nz = arr.get( 0 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 3.0\n\nim = imagf( z );\n// returns -3.0\n\n// Get the second array element:\nz = arr.get( 1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 4.0\n\nim = imagf( z );\n// returns -4.0\n```\n\nBy default, `end` equals the number of array elements (i.e., one more than the last array index). To limit the sequence length, provide an `end` argument.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 4 );\n\n// Set the array elements:\narr.set( new Complex64( 1.0, -1.0 ), 0 );\narr.set( new Complex64( 2.0, -2.0 ), 1 );\narr.set( new Complex64( 3.0, -3.0 ), 2 );\narr.set( new Complex64( 4.0, -4.0 ), 3 );\n\n// Get the third array element:\nvar z = arr.get( 2 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 3.0\n\nvar im = imagf( z );\n// returns -3.0\n\n// Get the last array element:\nz = arr.get( 3 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 4.0\n\nim = imagf( z );\n// returns -4.0\n\n// Copy the first two elements to the last two elements:\narr.copyWithin( 2, 0, 2 );\n\n// Get the third array element:\nz = arr.get( 2 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 1.0\n\nim = imagf( z );\n// returns -1.0\n\n// Get the last array element:\nz = arr.get( 3 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 2.0\n\nim = imagf( z );\n// returns -2.0\n```\n\nWhen a `target`, `start`, and/or `end` index is negative, the respective index is determined relative to the last array element. The following example achieves the same behavior as the previous example:\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 4 );\n\n// Set the array elements:\narr.set( new Complex64( 1.0, -1.0 ), 0 );\narr.set( new Complex64( 2.0, -2.0 ), 1 );\narr.set( new Complex64( 3.0, -3.0 ), 2 );\narr.set( new Complex64( 4.0, -4.0 ), 3 );\n\n// Get the third array element:\nvar z = arr.get( 2 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 3.0\n\nvar im = imagf( z );\n// returns -3.0\n\n// Get the last array element:\nz = arr.get( 3 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 4.0\n\nim = imagf( z );\n// returns -4.0\n\n// Copy the first two elements to the last two elements using negative indices:\narr.copyWithin( -2, -4, -2 );\n\n// Get the third array element:\nz = arr.get( 2 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 1.0\n\nim = imagf( z );\n// returns -1.0\n\n// Get the last array element:\nz = arr.get( 3 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 2.0\n\nim = imagf( z );\n// returns -2.0\n```\n\n\u003ca name=\"method-entries\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.entries()\n\nReturns an iterator for iterating over array key-value pairs.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = [\n    new Complex64( 1.0, -1.0 ),\n    new Complex64( 2.0, -2.0 ),\n    new Complex64( 3.0, -3.0 )\n];\narr = new Complex64Array( arr );\n\n// Create an iterator:\nvar it = arr.entries();\n\n// Iterate over the key-value pairs...\nvar v = it.next().value;\n// returns [ 0, \u003cComplex64\u003e ]\n\nvar re = realf( v[ 1 ] );\n// returns 1.0\n\nvar im = imagf( v[ 1 ] );\n// returns -1.0\n\nv = it.next().value;\n// returns [ 1, \u003cComplex64\u003e ]\n\nre = realf( v[ 1 ] );\n// returns 2.0\n\nim = imagf( v[ 1 ] );\n// returns -2.0\n\nv = it.next().value;\n// returns [ 2, \u003cComplex64\u003e ]\n\nre = realf( v[ 1 ] );\n// returns 3.0\n\nim = imagf( v[ 1 ] );\n// returns -3.0\n\nvar bool = it.next().done;\n// returns true\n```\n\nThe returned [iterator][mdn-iterator-protocol] protocol-compliant object has the following properties:\n\n-   **next**: function which returns an [iterator][mdn-iterator-protocol] protocol-compliant object containing the next iterated value (if one exists) assigned to a `value` property and a `done` property having a `boolean` value indicating whether the [iterator][mdn-iterator-protocol] is finished.\n-   **return**: function which closes an [iterator][mdn-iterator-protocol] and returns a single (optional) argument in an [iterator][mdn-iterator-protocol] protocol-compliant object.\n\n\u003ca name=\"method-every\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.every( predicate\\[, thisArg] )\n\nReturns a boolean indicating whether all elements pass a test.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction predicate( v ) {\n    return ( realf( v ) === imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\n// Set the first three elements:\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\n// Check whether all elements pass a test:\nvar z = arr.every( predicate );\n// returns true\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nfunction predicate( v, i ) {\n    this.count += 1;\n    return ( i \u003e= 0 );\n}\n\nvar arr = new Complex64Array( 3 );\n\nvar context = {\n    'count': 0\n};\n\n// Set the first three elements:\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar z = arr.every( predicate, context );\n// returns true\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-fill\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.fill( value\\[, start\\[, end]] )\n\nReturns a modified typed array filled with a fill value.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 3 );\n\n// Set all elements to the same value:\narr.fill( new Complex64( 1.0, 1.0 ) );\n\nvar z = arr.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 1.0\n\nvar im = imagf( z );\n// returns 1.0\n\nz = arr.get( 2 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 1.0\n\nim = imagf( z );\n// returns 1.0\n\n// Fill all elements starting from the second element:\narr.fill( new Complex64( 2.0, 2.0 ), 1 );\n\nz = arr.get( 1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 2.0\n\nim = imagf( z );\n// returns 2.0\n\nz = arr.get( 2 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 2.0\n\nim = imagf( z );\n// returns 2.0\n\n// Fill all elements from first element until the second-to-last element:\narr.fill( new Complex64( 3.0, 3.0 ), 0, 2 );\n\nz = arr.get( 0 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 3.0\n\nim = imagf( z );\n// returns 3.0\n\nz = arr.get( 1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 3.0\n\nim = imagf( z );\n// returns 3.0\n```\n\nWhen a `start` and/or `end` index is negative, the respective index is determined relative to the last array element.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 3 );\n\n// Set all array elements, except the last element, to the same value:\narr.fill( new Complex64( 1.0, 1.0 ), 0, -1 );\n\nvar z = arr.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 1.0\n\nvar im = imagf( z );\n// returns 1.0\n\nz = arr.get( arr.length - 1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 0.0\n\nim = imagf( z );\n// returns 0.0\n```\n\n\u003ca name=\"method-filter\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.filter( predicate\\[, thisArg] )\n\nReturns a new array containing the elements of an array which pass a test implemented by a predicate function.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction predicate( v ) {\n    return ( realf( v ) === imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\n// Set the first three elements:\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, -3.0 ], 2 );\n\nvar out = arr.filter( predicate );\n// returns \u003cComplex64Array\u003e\n\nvar len = out.length;\n// returns 1\n\nvar z = out.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 2.0\n\nvar im = imagf( z );\n// returns 2.0\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction predicate( v, i ) {\n    this.count += 1;\n    return ( i \u003e= 0 \u0026\u0026 realf( v ) === imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\nvar context = {\n    'count': 0\n};\n\n// Set the first three elements:\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar out = arr.filter( predicate, context );\n// returns \u003cComplex64Array\u003e\n\nvar len = out.length;\n// returns 2\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-find\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.find( predicate\\[, thisArg] )\n\nReturns the first element in an array for which a predicate function returns a truthy value.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\nfunction predicate( v ) {\n    return ( realf( v ) === imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\n// Set the first three elements:\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar z = arr.find( predicate );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 1.0\n\nvar im = imagf( z );\n// returns 1.0\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction predicate( v, i ) {\n    this.count += 1;\n    return ( i \u003e= 0 \u0026\u0026 realf( v ) === imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\nvar context = {\n    'count': 0\n};\n\n// Set the first three elements:\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar z = arr.find( predicate, context );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 2.0\n\nvar im = imagf( z );\n// returns 2.0\n\nvar count = context.count;\n// returns 2\n```\n\n\u003ca name=\"method-find-index\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.findIndex( predicate\\[, thisArg] )\n\nReturns the index of the first element in an array for which a predicate function returns a truthy value.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction predicate( v ) {\n    return ( realf( v ) === imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\n// Set the first three elements:\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar idx = arr.findIndex( predicate );\n// returns 2\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction predicate( v, i ) {\n    this.count += 1;\n    return ( i \u003e= 0 \u0026\u0026 realf( v ) === imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\nvar context = {\n    'count': 0\n};\n\n// Set the first three elements:\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\narr.set( [ 3.0, -3.0 ], 2 );\n\nvar idx = arr.findIndex( predicate, context );\n// returns -1\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-find-last\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.findLast( predicate\\[, thisArg] )\n\nReturns the last element in an array for which a predicate function returns a truthy value.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\nfunction predicate( v ) {\n    return ( realf( v ) === imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\n// Set the first three elements:\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar z = arr.findLast( predicate );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 3.0\n\nvar im = imagf( z );\n// returns 3.0\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction predicate( v, i ) {\n    this.count += 1;\n    return ( i \u003e= 0 \u0026\u0026 realf( v ) === imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\nvar context = {\n    'count': 0\n};\n\n// Set the first three elements:\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, -3.0 ], 2 );\n\nvar z = arr.findLast( predicate, context );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 2.0\n\nvar im = imagf( z );\n// returns 2.0\n\nvar count = context.count;\n// returns 2\n```\n\n\u003ca name=\"method-find-last-index\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.findLastIndex( predicate\\[, thisArg] )\n\nReturns the index of the last element in an array for which a predicate function returns a truthy value.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction predicate( v ) {\n    return ( realf( v ) === imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\n// Set the first three elements:\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, -3.0 ], 2 );\n\nvar idx = arr.findLastIndex( predicate );\n// returns 1\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction predicate( v, i ) {\n    this.count += 1;\n    return ( i \u003e= 0 \u0026\u0026 realf( v ) === imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\nvar context = {\n    'count': 0\n};\n\n// Set the first three elements:\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\narr.set( [ 3.0, -3.0 ], 2 );\n\nvar idx = arr.findLastIndex( predicate, context );\n// returns -1\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-for-each\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.forEach( callbackFn\\[, thisArg] )\n\nInvokes a function once for each array element.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\nfunction log( v, i ) {\n    console.log( '%s: %s', i, v.toString() );\n}\n\nvar arr = new Complex64Array( 3 );\n\n// Set the first three elements:\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\narr.forEach( log );\n/* =\u003e\n    0: 1 + 1i\n    1: 2 + 2i\n    2: 3 + 3i\n*/\n```\n\nThe invoked function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\nfunction fcn( v, i ) {\n    this.count += 1;\n    console.log( '%s: %s', i, v.toString() );\n}\n\nvar arr = new Complex64Array( 3 );\n\nvar context = {\n    'count': 0\n};\n\n// Set the first three elements:\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\narr.set( [ 3.0, -3.0 ], 2 );\n\narr.forEach( fcn, context );\n/* =\u003e\n    0: 1 + 1i\n    1: 2 + 2i\n    2: 3 + 3i\n*/\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-get\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.get( i )\n\nReturns an array element located at a nonnegative integer position (index) `i`.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 10 );\n\n// Set the first element:\narr.set( [ 1.0, -1.0 ], 0 );\n\n// Get the first element:\nvar z = arr.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 1.0\n\nvar im = imagf( z );\n// returns -1.0\n```\n\nIf provided an out-of-bounds index, the method returns `undefined`.\n\n```javascript\nvar arr = new Complex64Array( 10 );\n\nvar z = arr.get( 100 );\n// returns undefined\n```\n\n\u003ca name=\"method-includes\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.includes( searchElement\\[, fromIndex] )\n\nReturns a boolean indicating whether an array includes a provided value.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\nvar arr = new Complex64Array( 5 );\n\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\narr.set( [ 3.0, -3.0 ], 2 );\narr.set( [ 4.0, -4.0 ], 3 );\narr.set( [ 5.0, -5.0 ], 4 );\n\nvar bool = arr.includes( new Complex64( 3.0, -3.0 ) );\n// returns true\n\nbool = arr.includes( new Complex64( 3.0, -3.0 ), 3 );\n// returns false\n\nbool = arr.includes( new Complex64( 4.0, -4.0 ), -3 );\n// returns true\n```\n\n\u003ca name=\"method-index-of\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.indexOf( searchElement\\[, fromIndex] )\n\nReturns the first index at which a given element can be found.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\nvar arr = new Complex64Array( 5 );\n\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\narr.set( [ 3.0, -3.0 ], 2 );\narr.set( [ 4.0, -4.0 ], 3 );\narr.set( [ 2.0, -2.0 ], 4 );\n\nvar idx = arr.indexOf( new Complex64( 3.0, -3.0 ) );\n// returns 2\n\nidx = arr.indexOf( new Complex64( 2.0, -2.0 ), 2 );\n// returns 4\n\nidx = arr.indexOf( new Complex64( 4.0, -4.0 ), -3 );\n// returns 3\n```\n\nIf `searchElement` is not present in the array, the method returns `-1`.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\nvar arr = new Complex64Array( 10 );\n\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\n\nvar idx = arr.indexOf( new Complex64( 3.0, -3.0 ) );\n// returns -1\n\nidx = arr.indexOf( new Complex64( 1.0, -1.0 ), 1 );\n// returns -1\n```\n\n\u003ca name=\"method-join\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.join( \\[separator] )\n\nReturns a new string by concatenating all array elements.\n\n```javascript\nvar arr = new Complex64Array( 3 );\n\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar str = arr.join();\n// returns '1 + 1i,2 - 2i,3 + 3i'\n```\n\nBy default, the method separates serialized array elements with a comma. To use an alternative separator, provide a `separator` string.\n\n```javascript\nvar arr = new Complex64Array( 3 );\n\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar str = arr.join( '/' );\n// returns '1 + 1i/2 - 2i/3 + 3i'\n```\n\n\u003ca name=\"method-keys\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.keys()\n\nReturns an iterator for iterating over each index key in a typed array.\n\n```javascript\nvar arr = new Complex64Array( 2 );\n\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\n\nvar iter = arr.keys();\n\nvar v = iter.next().value;\n// returns 0\n\nv = iter.next().value;\n// returns 1\n\nvar bool = iter.next().done;\n// returns true\n```\n\nThe returned [iterator][mdn-iterator-protocol] protocol-compliant object has the following properties:\n\n-   **next**: function which returns an [iterator][mdn-iterator-protocol] protocol-compliant object containing the next iterated value (if one exists) assigned to a `value` property and a `done` property having a `boolean` value indicating whether the [iterator][mdn-iterator-protocol] is finished.\n-   **return**: function which closes an [iterator][mdn-iterator-protocol] and returns a single (optional) argument in an [iterator][mdn-iterator-protocol] protocol-compliant object.\n\n\u003ca name=\"method-last-index-of\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.lastIndexOf( searchElement\\[, fromIndex] )\n\nReturns the last index at which a given element can be found.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\nvar arr = new Complex64Array( 5 );\n\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\narr.set( [ 3.0, -3.0 ], 2 );\narr.set( [ 4.0, -4.0 ], 3 );\narr.set( [ 2.0, -2.0 ], 4 );\n\nvar idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) );\n// returns 2\n\nidx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), 2 );\n// returns 1\n\nidx = arr.lastIndexOf( new Complex64( 4.0, -4.0 ), -1 );\n// returns 3\n```\n\nIf `searchElement` is not present in the array, the method returns `-1`.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\nvar arr = new Complex64Array( 10 );\n\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\n\nvar idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) );\n// returns -1\n\nidx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), 0 );\n// returns -1\n```\n\n\u003ca name=\"method-map\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.map( callbackFn\\[, thisArg] )\n\nReturns a new array with each element being the result of a provided callback function.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction scale( v ) {\n    return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\n// Set the first three elements:\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\narr.set( [ 3.0, -3.0 ], 2 );\n\nvar out = arr.map( scale );\n// returns \u003cComplex64Array\u003e\n\nvar z = out.get( 0 );\n// returns \u003ccomplex64\u003e\n\nvar re = realf( z );\n// returns 2.0\n\nvar im = imagf( z );\n// returns -2.0\n```\n\nThe callback function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction scale( v ) {\n    this.count += 1;\n    return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\nvar context = {\n    'count': 0\n};\n\n// Set the first three elements:\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar out = arr.map( scale, context );\n// returns \u003cComplex64Array\u003e\n\nvar count = context.count;\n// returns 3\n```\n\n\u003ca name=\"method-reduce\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.reduce( reducerFn\\[, initialValue] )\n\nApplies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\nvar caddf = require( '@stdlib/complex-float32-base-add' );\n\nvar arr = new Complex64Array( 3 );\n\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar z = arr.reduce( caddf );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 6.0\n\nvar im = imagf( z );\n// returns 6.0\n```\n\nThe reducer function is provided four arguments:\n\n-   **acc**: accumulated result.\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nBy default, the function initializes the accumulated result to the first element in the array and passes the second array element as `value` during the first invocation of the provided callback. To begin accumulation from a different starting value and pass in the first array element as `value` during the first invocation of the provided callback, provide an `initialValue` argument.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\n\nfunction reducer( acc, v ) {\n    acc += realf( v );\n    return acc;\n}\n\nvar arr = new Complex64Array( 3 );\n\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar z = arr.reduce( reducer, 0.0 );\n// returns 6.0\n```\n\n\u003ca name=\"method-reduce-right\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.reduceRight( reducerFn\\[, initialValue] )\n\nApplies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the following element and returning the accumulated result upon completion.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\nvar caddf = require( '@stdlib/complex-float32-base-add' );\n\nvar arr = new Complex64Array( 3 );\n\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar z = arr.reduceRight( caddf );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 6.0\n\nvar im = imagf( z );\n// returns 6.0\n```\n\nThe reducer function is provided four arguments:\n\n-   **acc**: accumulated result.\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nBy default, the function initializes the accumulated result to the last element in the array and passes the second-last array element as `value` during the first invocation of the provided callback. To begin accumulation from a different starting value and pass in the last array element as `value` during the first invocation of the provided callback, provide an `initialValue` argument.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\n\nfunction reducer( acc, v ) {\n    acc += realf( v );\n    return acc;\n}\n\nvar arr = new Complex64Array( 3 );\n\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar z = arr.reduceRight( reducer, 0.0 );\n// returns 6.0\n```\n\n\u003ca name=\"method-reverse\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.reverse()\n\nReverses an array in-place.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 3 );\n\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar out = arr.reverse();\n// returns \u003cComplex64Array\u003e\n\nvar z = out.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 3.0\n\nvar im = imagf( z );\n// returns 3.0\n\nz = out.get( 1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 2.0\n\nim = imagf( z );\n// returns 2.0\n\nz = out.get( 2 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 1.0\n\nim = imagf( z );\n// returns 1.0\n```\n\n\u003ca name=\"method-set\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.set( z\\[, i] )\n\nSets one or more array elements.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 10 );\n\n// Get the first element:\nvar z = arr.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 0.0\n\nvar im = imagf( z );\n// returns 0.0\n\n// Set the first element:\narr.set( new Complex64( 1.0, -1.0 ) );\n\n// Get the first element:\nz = arr.get( 0 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 1.0\n\nim = imagf( z );\n// returns -1.0\n```\n\nBy default, the method sets array elements starting at position (index) `i = 0`. To set elements starting elsewhere in the array, provide an index argument `i`.\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 10 );\n\n// Get the fifth element:\nvar z = arr.get( 4 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 0.0\n\nvar im = imagf( z );\n// returns 0.0\n\n// Set the fifth element:\narr.set( new Complex64( 1.0, -1.0 ), 4 );\n\n// Get the fifth element:\nz = arr.get( 4 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 1.0\n\nim = imagf( z );\n// returns -1.0\n```\n\nIn addition to providing a complex number, to set one or more array elements, provide an array-like object containing either complex numbers\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 10 );\n\n// Define an array of complex numbers:\nvar buf = [\n    new Complex64( 1.0, -1.0 ),\n    new Complex64( 2.0, -2.0 ),\n    new Complex64( 3.0, -3.0 )\n];\n\n// Set the fifth, sixth, and seventh elements:\narr.set( buf, 4 );\n\n// Get the sixth element:\nvar z = arr.get( 5 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 2.0\n\nvar im = imagf( z );\n// returns -2.0\n```\n\nor interleaved real and imaginary components\n\n```javascript\nvar Float32Array = require( '@stdlib/array-float32' );\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 10 );\n\n// Define an interleaved array of real and imaginary components:\nvar buf = new Float32Array( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0 ] );\n\n// Set the fifth, sixth, and seventh elements:\narr.set( buf, 4 );\n\n// Get the sixth element:\nvar z = arr.get( 5 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 2.0\n\nvar im = imagf( z );\n// returns -2.0\n```\n\nA few notes:\n\n-   If `i` is out-of-bounds, the method throws an error.\n-   If a target array cannot accommodate all values (i.e., the length of source array plus `i` exceeds the target array length), the method throws an error.\n-   If provided a [typed array][@stdlib/array/typed] which shares an [`ArrayBuffer`][@stdlib/array/buffer] with the target array, the method will intelligently copy the source range to the destination range.\n\n\u003ca name=\"method-slice\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.slice( \\[start\\[, end]] )\n\nCopies a portion of a typed array to a new typed array.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n\nvar out = arr.slice();\n// returns \u003cComplex64Array\u003e\n\nvar len = out.length;\n// returns 4\n\nvar z = out.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 1.0\n\nvar im = imagf( z );\n// returns 2.0\n\nz = out.get( len-1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 7.0\n\nim = imagf( z );\n// returns 8.0\n```\n\nBy default, the method returns a typed array beginning with the first array element. To specify an alternative array index at which to begin, provide a `start` index (inclusive).\n\n```javascript\nvar imagf = require( '@stdlib/complex-float32-imag' );\nvar realf = require( '@stdlib/complex-float32-real' );\n\nvar arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n\nvar out = arr.slice( 1 );\n// returns \u003cComplex64Array\u003e\n\nvar len = out.length;\n// returns 3\n\nvar z = out.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 3.0\n\nvar im = imagf( z );\n// returns 4.0\n```\n\nBy default, the method returns a typed array which includes all array elements after `start`. To limit the number of array elements after `start`, provide an `end` index (exclusive).\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n\nvar out = arr.slice( 1, -1 );\n// returns \u003cComplex64Array\u003e\n\nvar len = out.length;\n// returns 2\n\nvar z = out.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 3.0\n\nvar im = imagf( z );\n// returns 4.0\n\nz = out.get( len-1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 5.0\n\nim = imagf( z );\n// returns 6.0\n```\n\n\u003ca name=\"method-some\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.some( predicate\\[, thisArg] )\n\nReturns a boolean indicating whether at least one element passes a test.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction predicate( v ) {\n    return ( realf( v ) === imagf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\n// Set the first three elements:\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, -3.0 ], 2 );\n\n// Check whether at least one element passes a test:\nvar z = arr.some( predicate );\n// returns true\n```\n\nThe `predicate` function is provided three arguments:\n\n-   **value**: current array element.\n-   **index**: current array element index.\n-   **arr**: the array on which this method was called.\n\nTo set the function execution context, provide a `thisArg`.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction predicate( v, i ) {\n    this.count += 1;\n    return ( imagf( v ) === realf( v ) );\n}\n\nvar arr = new Complex64Array( 3 );\n\nvar context = {\n    'count': 0\n};\n\n// Set the first three elements:\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, -3.0 ], 2 );\n\nvar z = arr.some( predicate, context );\n// returns true\n\nvar count = context.count;\n// returns 2\n```\n\n\u003ca name=\"method-sort\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.sort( compareFcn )\n\nSorts an array in-place.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction compare( a, b ) {\n    var re1;\n    var re2;\n    var im1;\n    var im2;\n    re1 = realf( a );\n    re2 = realf( b );\n    if ( re1 \u003c re2 ) {\n        return -1;\n    }\n    if ( re1 \u003e re2 ) {\n        return 1;\n    }\n    im1 = imagf( a );\n    im2 = imagf( b );\n    if ( im1 \u003c im2 ) {\n        return -1;\n    }\n    if ( im1 \u003e im2 ) {\n        return 1;\n    }\n    return 0;\n}\n\nvar arr = new Complex64Array( 3 );\n\narr.set( [ 3.0, -3.0 ], 0 );\narr.set( [ 1.0, -1.0 ], 1 );\narr.set( [ 2.0, -2.0 ], 2 );\n\nvar out = arr.sort( compare );\n// returns \u003cComplex64Array\u003e\n\nvar z = out.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 1.0\n\nvar im = imagf( z );\n// returns -1.0\n\nz = out.get( 1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 2.0\n\nim = imagf( z );\n// returns -2.0\n\nz = out.get( 2 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 3.0\n\nim = imagf( z );\n// returns -3.0\n```\n\nThe `compareFcn` determines the order of the elements. The function is called with the following arguments:\n\n-   **a**: the first element for comparison.\n-   **b**: the second element for comparison.\n\nThe function should return a number where:\n\n-   a negative value indicates that `a` should come before `b`.\n-   a positive value indicates that `a` should come after `b`.\n-   zero or `NaN` indicates that `a` and `b` are considered equal.\n\nIn contrast to real numbers, one cannot define a default order relation which is compatible with multiplication. Accordingly, users **must** explicitly provide a `compareFcn` argument and are thus responsible for specifying a complex number ordering.\n\n\u003ca name=\"method-subarray\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.subarray( \\[begin\\[, end]] )\n\nCreates a new typed array view over the same underlying [`ArrayBuffer`][@stdlib/array/buffer] and with the same underlying data type as the host array.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n\nvar subarr = arr.subarray();\n// returns \u003cComplex64Array\u003e\n\nvar len = subarr.length;\n// returns 4\n\nvar z = subarr.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 1.0\n\nvar im = imagf( z );\n// returns 2.0\n\nz = subarr.get( len-1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 7.0\n\nim = imagf( z );\n// returns 8.0\n```\n\nBy default, the method creates a typed array view beginning with the first array element. To specify an alternative array index at which to begin, provide a `begin` index (inclusive).\n\n```javascript\nvar imagf = require( '@stdlib/complex-float32-imag' );\nvar realf = require( '@stdlib/complex-float32-real' );\n\nvar arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n\nvar subarr = arr.subarray( 1 );\n// returns \u003cComplex64Array\u003e\n\nvar len = subarr.length;\n// returns 3\n\nvar z = subarr.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 3.0\n\nvar im = imagf( z );\n// returns 4.0\n```\n\nBy default, the method creates a typed array view which includes all array elements after `begin`. To limit the number of array elements after `begin`, provide an `end` index (exclusive).\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n\nvar subarr = arr.subarray( 1, -1 );\n// returns \u003cComplex64Array\u003e\n\nvar len = subarr.length;\n// returns 2\n\nvar z = subarr.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 3.0\n\nvar im = imagf( z );\n// returns 4.0\n\nz = subarr.get( len-1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 5.0\n\nim = imagf( z );\n// returns 6.0\n```\n\n\u003ca name=\"method-to-locale-string\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.toLocaleString( \\[locales\\[, options]] )\n\nSerializes an array as a locale-specific string.\n\n```javascript\nvar arr = new Complex64Array( 2 );\n\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\n\nvar str = arr.toLocaleString();\n// returns '1 + 1i,2 + 2i'\n```\n\nThe method supports the following arguments:\n\n-   **locales**: a string with a BCP 47 language tag or an array of such strings.\n-   **options**: configuration properties.\n\n\u003ca name=\"method-to-reversed\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.toReversed()\n\nReturns a new typed array containing the elements in reversed order.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nvar arr = new Complex64Array( 3 );\n\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar out = arr.toReversed();\n// returns \u003cComplex64Array\u003e\n\nvar z = out.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 3.0\n\nvar im = imagf( z );\n// returns 3.0\n\nz = out.get( 1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 2.0\n\nim = imagf( z );\n// returns 2.0\n\nz = out.get( 2 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 1.0\n\nim = imagf( z );\n// returns 1.0\n```\n\n\u003ca name=\"method-to-sorted\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.toSorted( compareFcn )\n\nReturns a new typed array containing the elements in sorted order.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\n\nfunction compare( a, b ) {\n    var re1;\n    var re2;\n    var im1;\n    var im2;\n    re1 = realf( a );\n    re2 = realf( b );\n    if ( re1 \u003c re2 ) {\n        return -1;\n    }\n    if ( re1 \u003e re2 ) {\n        return 1;\n    }\n    im1 = imagf( a );\n    im2 = imagf( b );\n    if ( im1 \u003c im2 ) {\n        return -1;\n    }\n    if ( im1 \u003e im2 ) {\n        return 1;\n    }\n    return 0;\n}\n\nvar arr = new Complex64Array( 3 );\n\narr.set( [ 3.0, -3.0 ], 0 );\narr.set( [ 1.0, -1.0 ], 1 );\narr.set( [ 2.0, -2.0 ], 2 );\n\nvar out = arr.toSorted( compare );\n// returns \u003cComplex64Array\u003e\n\nvar z = out.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 1.0\n\nvar im = imagf( z );\n// returns -1.0\n\nz = out.get( 1 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 2.0\n\nim = imagf( z );\n// returns -2.0\n\nz = out.get( 2 );\n// returns \u003cComplex64\u003e\n\nre = realf( z );\n// returns 3.0\n\nim = imagf( z );\n// returns -3.0\n```\n\nThe `compareFcn` determines the order of the elements. The function is called with the following arguments:\n\n-   **a**: the first element for comparison.\n-   **b**: the second element for comparison.\n\nThe function should return a number where:\n\n-   a negative value indicates that `a` should come before `b`.\n-   a positive value indicates that `a` should come after `b`.\n-   zero or `NaN` indicates that `a` and `b` are considered equal.\n\nIn contrast to real numbers, one cannot define a default order relation which is compatible with multiplication. Accordingly, users **must** explicitly provide a `compareFcn` argument and are thus responsible for specifying a complex number ordering.\n\n\u003ca name=\"method-to-string\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.toString()\n\nSerializes an array as a string.\n\n```javascript\nvar arr = new Complex64Array( 3 );\n\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 2 );\n\nvar str = arr.toString();\n// returns '1 + 1i,2 - 2i,3 + 3i'\n```\n\n\u003ca name=\"method-values\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.values()\n\nReturns an iterator for iterating over each value in a typed array.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\nvar arr = new Complex64Array( 2 );\n\narr.set( [ 1.0, -1.0 ], 0 );\narr.set( [ 2.0, -2.0 ], 1 );\n\nvar iter = arr.values();\n\nvar v = iter.next().value;\n// returns \u003cComplex64\u003e\n\nvar re = realf( v );\n// returns 1.0\n\nvar im = imagf( v );\n// returns -1.0\n\nv = iter.next().value;\n// returns \u003cComplex64\u003e\n\nre = realf( v );\n// returns 2.0\n\nim = imagf( v );\n// returns -2.0\n\nvar bool = iter.next().done;\n// returns true\n```\n\nThe returned [iterator][mdn-iterator-protocol] protocol-compliant object has the following properties:\n\n-   **next**: function which returns an [iterator][mdn-iterator-protocol] protocol-compliant object containing the next iterated value (if one exists) assigned to a `value` property and a `done` property having a `boolean` value indicating whether the [iterator][mdn-iterator-protocol] is finished.\n-   **return**: function which closes an [iterator][mdn-iterator-protocol] and returns a single (optional) argument in an [iterator][mdn-iterator-protocol] protocol-compliant object.\n\n\u003ca name=\"method-with\"\u003e\u003c/a\u003e\n\n#### Complex64Array.prototype.with( index, value )\n\nReturns a new typed array with the element at a provided index replaced with a provided value.\n\n```javascript\nvar realf = require( '@stdlib/complex-float32-real' );\nvar imagf = require( '@stdlib/complex-float32-imag' );\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\n\nvar arr = new Complex64Array( 3 );\n\narr.set( [ 1.0, 1.0 ], 0 );\narr.set( [ 2.0, 2.0 ], 1 );\narr.set( [ 3.0, 3.0 ], 1 );\n\nvar out = arr.with( 0, new Complex64( 4.0, 4.0 ) );\n// returns \u003cComplex64Array\u003e\n\nvar z = out.get( 0 );\n// returns \u003cComplex64\u003e\n\nvar re = realf( z );\n// returns 4.0\n\nvar im = imagf( z );\n// returns 4.0\n```\n\n\u003c/section\u003e\n\n\u003c!-- /.usage --\u003e\n\n\u003c!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --\u003e\n\n\u003csection class=\"notes\"\u003e\n\n* * *\n\n## Notes\n\n-   While a `Complex64Array` _strives_ to maintain (but does not **guarantee**) consistency with [typed arrays][@stdlib/array/typed], significant deviations from ECMAScript-defined [typed array][@stdlib/array/typed] behavior are as follows:\n\n    -   The constructor does **not** require the `new` operator.\n    -   The constructor and associated methods support a broader variety of input argument types in order to better accommodate complex number input.\n    -   Accessing array elements using bracket syntax (e.g., `Z[i]`) is **not** supported. Instead, one **must** use the `.get()` method which returns a value compatible with complex number output.\n    -   The `set` method has extended behavior in order to support complex numbers.\n\n\u003c/section\u003e\n\n\u003c!-- /.notes --\u003e\n\n\u003c!-- Package usage examples. --\u003e\n\n\u003csection class=\"examples\"\u003e\n\n* * *\n\n## Examples\n\n\u003c!-- eslint no-undef: \"error\" --\u003e\n\n```javascript\nvar Complex64 = require( '@stdlib/complex-float32-ctor' );\nvar Float32Array = require( '@stdlib/array-float32' );\nvar logEach = require( '@stdlib/console-log-each' );\nvar Complex64Array = require( '@stdlib/array-complex64' );\n\n// Create a complex array by specifying a length:\nvar out = new Complex64Array( 3 );\nlogEach( '%s', out );\n\n// Create a complex array from an array of complex numbers:\nvar arr = [\n    new Complex64( 1.0, -1.0 ),\n    new Complex64( -3.14, 3.14 ),\n    new Complex64( 0.5, 0.5 )\n];\nout = new Complex64Array( arr );\nlogEach( '%s', out );\n\n// Create a complex array from an interleaved typed array:\narr = new Float32Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] );\nout = new Complex64Array( arr );\nlogEach( '%s', out );\n\n// Create a complex array from an array buffer:\narr = new Float32Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] );\nout = new Complex64Array( arr.buffer );\nlogEach( '%s', out );\n\n// Create a complex array from an array buffer view:\narr = new Float32Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] );\nout = new Complex64Array( arr.buffer, 8, 2 );\nlogEach( '%s', out );\n```\n\n\u003c/section\u003e\n\n\u003c!-- /.examples --\u003e\n\n\u003c!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. --\u003e\n\n\u003csection class=\"references\"\u003e\n\n\u003c/section\u003e\n\n\u003c!-- /.references --\u003e\n\n\u003c!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. --\u003e\n\n\u003csection class=\"related\"\u003e\n\n* * *\n\n## See Also\n\n-   \u003cspan class=\"package-name\"\u003e[`@stdlib/array-complex128`][@stdlib/array/complex128]\u003c/span\u003e\u003cspan class=\"delimiter\"\u003e: \u003c/span\u003e\u003cspan class=\"description\"\u003eComplex128Array.\u003c/span\u003e\n-   \u003cspan class=\"package-name\"\u003e[`@stdlib/complex-cmplx`][@stdlib/complex/cmplx]\u003c/span\u003e\u003cspan class=\"delimiter\"\u003e: \u003c/span\u003e\u003cspan class=\"description\"\u003ecreate a complex number.\u003c/span\u003e\n-   \u003cspan class=\"package-name\"\u003e[`@stdlib/complex-float32/ctor`][@stdlib/complex/float32/ctor]\u003c/span\u003e\u003cspan class=\"delimiter\"\u003e: \u003c/span\u003e\u003cspan class=\"description\"\u003e64-bit complex number.\u003c/span\u003e\n\n\u003c/section\u003e\n\n\u003c!-- /.related --\u003e\n\n\u003c!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --\u003e\n\n\n\u003csection class=\"main-repo\" \u003e\n\n* * *\n\n## Notice\n\nThis package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.\n\nFor more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].\n\n#### Community\n\n[![Chat][chat-image]][chat-url]\n\n---\n\n## License\n\nSee [LICENSE][stdlib-license].\n\n\n## Copyright\n\nCopyright \u0026copy; 2016-2025. The Stdlib [Authors][stdlib-authors].\n\n\u003c/section\u003e\n\n\u003c!-- /.stdlib --\u003e\n\n\u003c!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --\u003e\n\n\u003csection class=\"links\"\u003e\n\n[npm-image]: http://img.shields.io/npm/v/@stdlib/array-complex64.svg\n[npm-url]: https://npmjs.org/package/@stdlib/array-complex64\n\n[test-image]: https://github.com/stdlib-js/array-complex64/actions/workflows/test.yml/badge.svg?branch=main\n[test-url]: https://github.com/stdlib-js/array-complex64/actions/workflows/test.yml?query=branch:main\n\n[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-complex64/main.svg\n[coverage-url]: https://codecov.io/github/stdlib-js/array-complex64?branch=main\n\n\u003c!--\n\n[dependencies-image]: https://img.shields.io/david/stdlib-js/array-complex64.svg\n[dependencies-url]: https://david-dm.org/stdlib-js/array-complex64/main\n\n--\u003e\n\n[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg\n[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im\n\n[stdlib]: https://github.com/stdlib-js/stdlib\n\n[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors\n\n[umd]: https://github.com/umdjs/umd\n[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules\n\n[deno-url]: https://github.com/stdlib-js/array-complex64/tree/deno\n[deno-readme]: https://github.com/stdlib-js/array-complex64/blob/deno/README.md\n[umd-url]: https://github.com/stdlib-js/array-complex64/tree/umd\n[umd-readme]: https://github.com/stdlib-js/array-complex64/blob/umd/README.md\n[esm-url]: https://github.com/stdlib-js/array-complex64/tree/esm\n[esm-readme]: https://github.com/stdlib-js/array-complex64/blob/esm/README.md\n[branches-url]: https://github.com/stdlib-js/array-complex64/blob/main/branches.md\n\n[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-complex64/main/LICENSE\n\n[mdn-iterator-protocol]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterator_protocol\n\n[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed\n\n[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer\n\n[@stdlib/complex/float32/ctor]: https://github.com/stdlib-js/complex-float32-ctor\n\n\u003c!-- \u003crelated-links\u003e --\u003e\n\n[@stdlib/array/complex128]: https://github.com/stdlib-js/array-complex128\n\n[@stdlib/complex/cmplx]: https://github.com/stdlib-js/complex-cmplx\n\n\u003c!-- \u003c/related-links\u003e --\u003e\n\n\u003c/section\u003e\n\n\u003c!-- /.links --\u003e\n","funding_links":["https://github.com/sponsors/stdlib-js","https://opencollective.com/stdlib","https://tidelift.com/funding/github/npm/@stdlib/stdlib"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdlib-js%2Farray-complex64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstdlib-js%2Farray-complex64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdlib-js%2Farray-complex64/lists"}