diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index dab5d2a..0000000
--- a/.editorconfig
+++ /dev/null
@@ -1,180 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2017 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# EditorConfig configuration file (see ).
-
-# Indicate that this file is a root-level configuration file:
-root = true
-
-# Set properties for all files:
-[*]
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-# Set properties for JavaScript files:
-[*.{js,js.txt}]
-indent_style = tab
-
-# Set properties for JavaScript ES module files:
-[*.{mjs,mjs.txt}]
-indent_style = tab
-
-# Set properties for JavaScript CommonJS files:
-[*.{cjs,cjs.txt}]
-indent_style = tab
-
-# Set properties for JSON files:
-[*.{json,json.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for `cli_opts.json` files:
-[cli_opts.json]
-indent_style = tab
-
-# Set properties for TypeScript files:
-[*.ts]
-indent_style = tab
-
-# Set properties for Python files:
-[*.{py,py.txt}]
-indent_style = space
-indent_size = 4
-
-# Set properties for Julia files:
-[*.{jl,jl.txt}]
-indent_style = tab
-
-# Set properties for R files:
-[*.{R,R.txt}]
-indent_style = tab
-
-# Set properties for C files:
-[*.{c,c.txt}]
-indent_style = tab
-
-# Set properties for C header files:
-[*.{h,h.txt}]
-indent_style = tab
-
-# Set properties for C++ files:
-[*.{cpp,cpp.txt}]
-indent_style = tab
-
-# Set properties for C++ header files:
-[*.{hpp,hpp.txt}]
-indent_style = tab
-
-# Set properties for Fortran files:
-[*.{f,f.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for shell files:
-[*.{sh,sh.txt}]
-indent_style = tab
-
-# Set properties for AWK files:
-[*.{awk,awk.txt}]
-indent_style = tab
-
-# Set properties for HTML files:
-[*.{html,html.txt}]
-indent_style = tab
-tab_width = 2
-
-# Set properties for XML files:
-[*.{xml,xml.txt}]
-indent_style = tab
-tab_width = 2
-
-# Set properties for CSS files:
-[*.{css,css.txt}]
-indent_style = tab
-
-# Set properties for Makefiles:
-[Makefile]
-indent_style = tab
-
-[*.{mk,mk.txt}]
-indent_style = tab
-
-# Set properties for Markdown files:
-[*.{md,md.txt}]
-indent_style = space
-indent_size = 4
-trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim.
-
-# Set properties for `usage.txt` files:
-[usage.txt]
-indent_style = space
-indent_size = 2
-
-# Set properties for `repl.txt` files:
-[repl.txt]
-indent_style = space
-indent_size = 4
-
-# Set properties for `package.json` files:
-[package.{json,json.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for `datapackage.json` files:
-[datapackage.json]
-indent_style = space
-indent_size = 2
-
-# Set properties for `manifest.json` files:
-[manifest.json]
-indent_style = space
-indent_size = 2
-
-# Set properties for `tsconfig.json` files:
-[tsconfig.json]
-indent_style = space
-indent_size = 2
-
-# Set properties for LaTeX files:
-[*.{tex,tex.txt}]
-indent_style = tab
-
-# Set properties for LaTeX Bibliography files:
-[*.{bib,bib.txt}]
-indent_style = tab
-
-# Set properties for YAML files:
-[*.{yml,yml.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for GYP files:
-[binding.gyp]
-indent_style = space
-indent_size = 2
-
-[*.gypi]
-indent_style = space
-indent_size = 2
-
-# Set properties for citation files:
-[*.{cff,cff.txt}]
-indent_style = space
-indent_size = 2
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index 5f30286..0000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1 +0,0 @@
-/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 1c88e69..0000000
--- a/.gitattributes
+++ /dev/null
@@ -1,66 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2017 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Configuration file which assigns attributes to pathnames.
-#
-# [1]: https://git-scm.com/docs/gitattributes
-
-# Automatically normalize the line endings of any committed text files:
-* text=auto
-
-# Override line endings for certain files on checkout:
-*.crlf.csv text eol=crlf
-
-# Denote that certain files are binary and should not be modified:
-*.png binary
-*.jpg binary
-*.jpeg binary
-*.gif binary
-*.ico binary
-*.gz binary
-*.zip binary
-*.7z binary
-*.mp3 binary
-*.mp4 binary
-*.mov binary
-
-# Override what is considered "vendored" by GitHub's linguist:
-/lib/node_modules/** -linguist-vendored -linguist-generated
-
-# Configure directories which should *not* be included in GitHub language statistics:
-/deps/** linguist-vendored
-/dist/** linguist-generated
-/workshops/** linguist-vendored
-
-benchmark/** linguist-vendored
-docs/* linguist-documentation
-etc/** linguist-vendored
-examples/** linguist-documentation
-scripts/** linguist-vendored
-test/** linguist-vendored
-tools/** linguist-vendored
-
-# Configure files which should *not* be included in GitHub language statistics:
-Makefile linguist-vendored
-*.mk linguist-vendored
-*.jl linguist-vendored
-*.py linguist-vendored
-*.R linguist-vendored
-
-# Configure files which should be included in GitHub language statistics:
-docs/types/*.d.ts -linguist-documentation
diff --git a/.github/.keepalive b/.github/.keepalive
deleted file mode 100644
index 86ed915..0000000
--- a/.github/.keepalive
+++ /dev/null
@@ -1 +0,0 @@
-2025-03-10T01:07:46.612Z
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index 8905fbb..0000000
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/utils/prepend) of the main repository where we’ll review and provide feedback.
-
-If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) for help on developing stdlib.
-
-We look forward to receiving your contribution! :smiley:
\ No newline at end of file
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
deleted file mode 100644
index e4f10fe..0000000
--- a/.github/workflows/benchmark.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2021 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Workflow name:
-name: benchmark
-
-# Workflow triggers:
-on:
- # Allow the workflow to be manually run:
- workflow_dispatch:
-
-# Workflow jobs:
-jobs:
-
- # Define a job to run benchmarks:
- benchmark:
-
- # Define a display name:
- name: 'Run benchmarks'
-
- # Define the type of virtual host machine:
- runs-on: 'ubuntu-latest'
-
- # Define the sequence of job steps...
- steps:
-
- # Checkout the repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: 'Install production and development dependencies'
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Run benchmarks:
- - name: 'Run benchmarks'
- run: |
- npm run benchmark
diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml
deleted file mode 100644
index b5291db..0000000
--- a/.github/workflows/cancel.yml
+++ /dev/null
@@ -1,57 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2021 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Workflow name:
-name: cancel
-
-# Workflow triggers:
-on:
- # Allow the workflow to be manually run:
- workflow_dispatch:
-
-# Workflow jobs:
-jobs:
-
- # Define a job to cancel existing workflow runs:
- cancel:
-
- # Define a display name:
- name: 'Cancel workflow runs'
-
- # Define the type of virtual host machine:
- runs-on: 'ubuntu-latest'
-
- # Time limit:
- timeout-minutes: 3
-
- # Define the sequence of job steps...
- steps:
-
- # Cancel existing workflow runs:
- - name: 'Cancel existing workflow runs'
- # Pin action to full length commit SHA
- uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1
- with:
- workflow_id: >-
- benchmark.yml,
- examples.yml,
- test.yml,
- test_coverage.yml,
- test_install.yml,
- publish.yml
- access_token: ${{ github.token }}
diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml
deleted file mode 100644
index b69a5af..0000000
--- a/.github/workflows/close_pull_requests.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2021 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Workflow name:
-name: close_pull_requests
-
-# Workflow triggers:
-on:
- pull_request_target:
- types: [opened]
-
-# Workflow jobs:
-jobs:
-
- # Define job to close all pull requests:
- run:
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Define the sequence of job steps...
- steps:
-
- # Close pull request
- - name: 'Close pull request'
- # Pin action to full length commit SHA corresponding to v3.1.2
- uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448
- with:
- comment: |
- Thank you for submitting a pull request. :raised_hands:
-
- We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib).
-
- We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/utils/prepend) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions.
-
- Thank you again, and we look forward to receiving your contribution! :smiley:
-
- Best,
- The stdlib team
\ No newline at end of file
diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml
deleted file mode 100644
index 2984901..0000000
--- a/.github/workflows/examples.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2021 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Workflow name:
-name: examples
-
-# Workflow triggers:
-on:
- # Allow the workflow to be manually run:
- workflow_dispatch:
-
-# Workflow jobs:
-jobs:
-
- # Define a job to run the package examples...
- examples:
-
- # Define display name:
- name: 'Run examples'
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Define the sequence of job steps...
- steps:
-
- # Checkout repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: 'Install production and development dependencies'
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Run examples:
- - name: 'Run examples'
- run: |
- npm run examples
diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml
deleted file mode 100644
index be2bd7f..0000000
--- a/.github/workflows/npm_downloads.yml
+++ /dev/null
@@ -1,112 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2022 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Workflow name:
-name: npm_downloads
-
-# Workflow triggers:
-on:
- # Run this workflow weekly:
- schedule:
- # cron: ' '
- - cron: '10 22 * * 0'
-
- # Allow the workflow to be manually run:
- workflow_dispatch:
-
-# Workflow jobs:
-jobs:
-
- # Define a job for retrieving npm download counts...
- npm_downloads:
-
- # Define display name:
- name: 'Retrieve npm download counts'
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Define the sequence of job steps...
- steps:
- # Checkout the repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- timeout-minutes: 10
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Resolve package name:
- - name: 'Resolve package name'
- id: package_name
- run: |
- name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'`
- echo "package_name=$name" >> $GITHUB_OUTPUT
- timeout-minutes: 5
-
- # Fetch download data:
- - name: 'Fetch data'
- id: download_data
- run: |
- url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}"
- echo "$url"
- data=$(curl "$url")
- mkdir ./tmp
- echo "$data" > ./tmp/npm_downloads.json
- echo "data=$data" >> $GITHUB_OUTPUT
- timeout-minutes: 5
-
- # Print summary of download data:
- - name: 'Print summary'
- run: |
- echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY
- echo "|------|------------|" >> $GITHUB_STEP_SUMMARY
- cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY
-
- # Upload the download data:
- - name: 'Upload data'
- # Pin action to full length commit SHA
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
- with:
- # Define a name for the uploaded artifact (ensuring a unique name for each job):
- name: npm_downloads
-
- # Specify the path to the file to upload:
- path: ./tmp/npm_downloads.json
-
- # Specify the number of days to retain the artifact (default is 90 days):
- retention-days: 90
- timeout-minutes: 10
- if: success()
-
- # Send data to events server:
- - name: 'Post data'
- # Pin action to full length commit SHA
- uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3
- env:
- webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }}
- webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }}
- data: '{ "downloads": ${{ steps.download_data.outputs.data }} }'
- timeout-minutes: 5
- if: success()
diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml
deleted file mode 100644
index f4575e9..0000000
--- a/.github/workflows/productionize.yml
+++ /dev/null
@@ -1,794 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2022 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Workflow name:
-name: productionize
-
-# Workflow triggers:
-on:
- # Run workflow when a new commit is pushed to the main branch:
- push:
- branches:
- - main
-
- # Allow the workflow to be manually run:
- workflow_dispatch:
- inputs:
- require-passing-tests:
- description: 'Require passing tests for creating bundles'
- type: boolean
- default: true
-
- # Run workflow upon completion of `publish` workflow run:
- workflow_run:
- workflows: ["publish"]
- types: [completed]
-
-
-# Concurrency group to prevent multiple concurrent executions:
-concurrency:
- group: productionize
- cancel-in-progress: true
-
-# Workflow jobs:
-jobs:
-
- # Define a job to create a production build...
- productionize:
-
- # Define display name:
- name: 'Productionize'
-
- # Define the type of virtual host machine:
- runs-on: 'ubuntu-latest'
-
- # Define the sequence of job steps...
- steps:
- # Checkout main branch of repository:
- - name: 'Checkout main branch'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- with:
- ref: main
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Create production branch:
- - name: 'Create production branch'
- run: |
- git checkout -b production
-
- # Transform error messages:
- - name: 'Transform error messages'
- id: transform-error-messages
- uses: stdlib-js/transform-errors-action@main
-
- # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency:
- - name: 'Update dependencies in package.json'
- run: |
- PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version)
- if grep -q '"@stdlib/string-format"' package.json; then
- sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json
- else
- node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^$PKG_VERSION'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );"
- fi
-
- # Configure Git:
- - name: 'Configure Git'
- run: |
- git config --local user.email "noreply@stdlib.io"
- git config --local user.name "stdlib-bot"
-
- # Commit changes:
- - name: 'Commit changes'
- run: |
- git add -A
- git commit -m "Transform error messages"
-
- # Push changes:
- - name: 'Push changes'
- run: |
- SLUG=${{ github.repository }}
- echo "Pushing changes to $SLUG..."
- git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force
-
- # Define a job for running tests of the productionized code...
- test:
-
- # Define a display name:
- name: 'Run Tests'
-
- # Define the type of virtual host machine:
- runs-on: 'ubuntu-latest'
-
- # Indicate that this job depends on the prior job finishing:
- needs: productionize
-
- # Run this job regardless of the outcome of the prior job:
- if: always()
-
- # Define the sequence of job steps...
- steps:
-
- # Checkout the repository:
- - name: 'Checkout repository'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- with:
- # Use the `production` branch:
- ref: production
-
- # Install Node.js:
- - name: 'Install Node.js'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: 'Install production and development dependencies'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- id: install
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Build native add-on if present:
- - name: 'Build native add-on (if present)'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- run: |
- if [ -f "binding.gyp" ]; then
- npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild
- fi
-
- # Run tests:
- - name: 'Run tests'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- id: tests
- run: |
- npm test || npm test || npm test
-
- # Define job to create a bundle for use in Deno...
- deno:
-
- # Define display name:
- name: 'Create Deno bundle'
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Indicate that this job depends on the test job finishing:
- needs: test
-
- # Define the sequence of job steps...
- steps:
- # Checkout the repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
-
- # Configure Git:
- - name: 'Configure Git'
- run: |
- git config --local user.email "noreply@stdlib.io"
- git config --local user.name "stdlib-bot"
-
- # Check if remote `deno` branch exists:
- - name: 'Check if remote `deno` branch exists'
- id: deno-branch-exists
- continue-on-error: true
- run: |
- git fetch --all
- git ls-remote --exit-code --heads origin deno
- if [ $? -eq 0 ]; then
- echo "remote-exists=true" >> $GITHUB_OUTPUT
- else
- echo "remote-exists=false" >> $GITHUB_OUTPUT
- fi
-
- # If `deno` exists, delete everything in branch and merge `production` into it
- - name: 'If `deno` exists, delete everything in branch and merge `production` into it'
- if: steps.deno-branch-exists.outputs.remote-exists
- run: |
- git checkout -b deno origin/deno
-
- find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm
- find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf
-
- git add -A
- git commit -m "Remove files" --allow-empty
-
- git config merge.theirs.name 'simulate `-s theirs`'
- git config merge.theirs.driver 'cat %B > %A'
- GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories
-
- # Copy files from `production` branch if necessary:
- git checkout origin/production -- .
- if [ -n "$(git status --porcelain)" ]; then
- git add -A
- git commit -m "Auto-generated commit"
- fi
-
- # If `deno` does not exist, create `deno` branch:
- - name: 'If `deno` does not exist, create `deno` branch'
- if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }}
- run: |
- git checkout production
- git checkout -b deno
-
- # Copy files to deno directory:
- - name: 'Copy files to deno directory'
- run: |
- mkdir -p deno
- cp README.md LICENSE CONTRIBUTORS NOTICE ./deno
-
- # Copy TypeScript definitions to deno directory:
- if [ -d index.d.ts ]; then
- cp index.d.ts ./deno/index.d.ts
- fi
- if [ -e ./docs/types/index.d.ts ]; then
- cp ./docs/types/index.d.ts ./deno/mod.d.ts
- fi
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: Install production and development dependencies
- id: install
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Bundle package for use in Deno:
- - name: 'Bundle package for Deno'
- id: deno-bundle
- uses: stdlib-js/bundle-action@main
- with:
- target: 'deno'
-
- # Rewrite file contents:
- - name: 'Rewrite file contents'
- run: |
- # Replace links to other packages with links to the deno branch:
- find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/";
-
- # Replace reference to `@stdlib/types` with CDN link:
- find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g"
-
- # Change wording of project description to avoid reference to JavaScript and Node.js:
- find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g"
-
- # Rewrite all `require()`s to use jsDelivr links:
- find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// {
- s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i
- s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/
- s/';/@deno\/mod.js';/
- }"
-
- # Rewrite first `import` to show importing of named exports if available:
- exports=$(cat lib/index.js | \
- grep -E 'setReadOnly\(.*,.*,.*\)' | \
- sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \
- sed -E "s/'//g" | \
- sort)
- if [ -n "$exports" ]; then
- find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/"
- fi
-
- # Remove `installation`, `cli`, and `c` sections:
- find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/[^<]+<\/section>//g;"
- find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?[\s\S]+<\!\-\- \/.cli \-\->//g"
- find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?[\s\S]+<\!\-\- \/.c \-\->//g"
-
- # Create package.json file for deno branch:
- jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json
-
- # Delete everything in current directory aside from deno folder:
- - name: 'Delete everything in current directory aside from deno folder'
- run: |
- find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm
- find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf
-
- # Move deno directory to root:
- - name: 'Move deno directory to root'
- run: |
- mv ./deno/* .
- rmdir ./deno
-
- # Commit changes:
- - name: 'Commit changes'
- run: |
- git add -A
- git commit -m "Auto-generated commit"
-
- # Push changes to `deno` branch:
- - name: 'Push changes to `deno` branch'
- run: |
- SLUG=${{ github.repository }}
- echo "Pushing changes to $SLUG..."
- git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno
-
- # Send status to Slack channel if job fails:
- - name: 'Send status to Slack channel in case of failure'
- # Pin action to full length commit SHA
- uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
- with:
- status: ${{ job.status }}
- channel: '#npm-ci'
- if: failure()
-
- # Define job to create a UMD bundle...
- umd:
-
- # Define display name:
- name: 'Create UMD bundle'
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Indicate that this job depends on the test job finishing:
- needs: test
-
- # Define the sequence of job steps...
- steps:
- # Checkout the repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
-
- # Configure Git:
- - name: 'Configure Git'
- run: |
- git config --local user.email "noreply@stdlib.io"
- git config --local user.name "stdlib-bot"
-
- # Check if remote `umd` branch exists:
- - name: 'Check if remote `umd` branch exists'
- id: umd-branch-exists
- continue-on-error: true
- run: |
- git fetch --all
- git ls-remote --exit-code --heads origin umd
- if [ $? -eq 0 ]; then
- echo "remote-exists=true" >> $GITHUB_OUTPUT
- else
- echo "remote-exists=false" >> $GITHUB_OUTPUT
- fi
-
- # If `umd` exists, delete everything in branch and merge `production` into it
- - name: 'If `umd` exists, delete everything in branch and merge `production` into it'
- if: steps.umd-branch-exists.outputs.remote-exists
- run: |
- git checkout -b umd origin/umd
-
- find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm
- find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf
-
- git add -A
- git commit -m "Remove files" --allow-empty
-
- git config merge.theirs.name 'simulate `-s theirs`'
- git config merge.theirs.driver 'cat %B > %A'
- GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories
-
- # Copy files from `production` branch if necessary:
- git checkout origin/production -- .
- if [ -n "$(git status --porcelain)" ]; then
- git add -A
- git commit -m "Auto-generated commit"
- fi
-
- # If `umd` does not exist, create `umd` branch:
- - name: 'If `umd` does not exist, create `umd` branch'
- if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }}
- run: |
- git checkout production
- git checkout -b umd
-
- # Copy files to umd directory:
- - name: 'Copy files to umd directory'
- run: |
- mkdir -p umd
- cp README.md LICENSE CONTRIBUTORS NOTICE ./umd
-
- # Install Node.js
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: 'Install production and development dependencies'
- id: install
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Extract alias:
- - name: 'Extract alias'
- id: extract-alias
- run: |
- alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/')
- echo "alias=${alias}" >> $GITHUB_OUTPUT
-
- # Create Universal Module Definition (UMD) Node.js bundle:
- - name: 'Create Universal Module Definition (UMD) Node.js bundle'
- id: umd-bundle-node
- uses: stdlib-js/bundle-action@main
- with:
- target: 'umd-node'
- alias: ${{ steps.extract-alias.outputs.alias }}
-
- # Create Universal Module Definition (UMD) browser bundle:
- - name: 'Create Universal Module Definition (UMD) browser bundle'
- id: umd-bundle-browser
- uses: stdlib-js/bundle-action@main
- with:
- target: 'umd-browser'
- alias: ${{ steps.extract-alias.outputs.alias }}
-
- # Rewrite file contents:
- - name: 'Rewrite file contents'
- run: |
-
- # Replace links to other packages with links to the umd branch:
- find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/";
-
- # Remove `installation`, `cli`, and `c` sections:
- find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/[^<]+<\/section>//g;"
- find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?[\s\S]+<\!\-\- \/.cli \-\->//g"
- find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?[\s\S]+<\!\-\- \/.c \-\->//g"
-
- # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag:
- find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n
+```
-```javascript
-var prepend = require( '@stdlib/utils-prepend' );
+If no recognized module system is present, access bundle contents via the global scope:
+
+```html
+
```
#### prepend( collection1, collection2 )
@@ -140,9 +146,14 @@ bool = ( out.buffer === arr.buffer );
-```javascript
-var Float64Array = require( '@stdlib/array-float64' );
-var prepend = require( '@stdlib/utils-prepend' );
+```html
+
+
+
+
+
+
+
+
```
@@ -265,9 +281,9 @@ Copyright © 2016-2025. The Stdlib [Authors][stdlib-authors].
-[@stdlib/utils/append]: https://github.com/stdlib-js/utils-append
+[@stdlib/utils/append]: https://github.com/stdlib-js/utils-append/tree/umd
-[@stdlib/utils/unshift]: https://github.com/stdlib-js/utils-unshift
+[@stdlib/utils/unshift]: https://github.com/stdlib-js/utils-unshift/tree/umd
diff --git a/SECURITY.md b/SECURITY.md
deleted file mode 100644
index 9702d4c..0000000
--- a/SECURITY.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Security
-
-> Policy for reporting security vulnerabilities.
-
-See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js
deleted file mode 100644
index 73600b1..0000000
--- a/benchmark/benchmark.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var bench = require( '@stdlib/bench-harness' );
-var pkg = require( './../package.json' ).name;
-var prepend = require( './../lib' );
-
-
-// MAIN //
-
-bench( pkg+'::array', function benchmark( b ) {
- var arr;
- var i;
-
- arr = [];
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i, i+1, i+2 ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::built-in', function benchmark( b ) {
- var arr;
- var i;
-
- arr = [];
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr.unshift( i, i+1, i+2 );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::built-in,apply', function benchmark( b ) {
- var unshift;
- var arr;
- var i;
-
- unshift = Array.prototype.unshift;
-
- arr = [];
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- unshift.apply( arr, [ i, i+1, i+2 ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
diff --git a/benchmark/benchmark.object.js b/benchmark/benchmark.object.js
deleted file mode 100644
index 45c69fd..0000000
--- a/benchmark/benchmark.object.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var bench = require( '@stdlib/bench-harness' );
-var pkg = require( './../package.json' ).name;
-var prepend = require( './../lib' );
-
-
-// MAIN //
-
-bench( pkg+'::object', function benchmark( b ) {
- var arr;
- var i;
-
- arr = {
- 'length': 0
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i, i+1, i+2 ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::built-in,object', function benchmark( b ) {
- var unshift;
- var arr;
- var i;
-
- unshift = Array.prototype.unshift;
-
- arr = {
- 'length': 0
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- unshift.apply( arr, [ i, i+1, i+2 ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
diff --git a/benchmark/benchmark.preallocation.js b/benchmark/benchmark.preallocation.js
deleted file mode 100644
index b3d930d..0000000
--- a/benchmark/benchmark.preallocation.js
+++ /dev/null
@@ -1,138 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var bench = require( '@stdlib/bench-harness' );
-var Float64Array = require( '@stdlib/array-float64' );
-var ArrayBuffer = require( '@stdlib/array-buffer' );
-var pkg = require( './../package.json' ).name;
-var prepend = require( './../lib' );
-
-
-// MAIN //
-
-bench( pkg+'::float64array,preallocated', function benchmark( b ) {
- var arr;
- var buf;
- var i;
-
- buf = new ArrayBuffer( b.iterations*8*3 ); // 8 bytes per double
- arr = new Float64Array( buf, buf.byteLength, 0 );
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i, i+1, i+2 ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::float64array,preallocated,no-wrapper', function benchmark( b ) {
- var prepend;
- var arr;
- var buf;
- var i;
-
- prepend = require( './../lib/prepend_typed_array.js' );
-
- buf = new ArrayBuffer( b.iterations*8*3 ); // 8 bytes per double
- arr = new Float64Array( buf, b.iterations*8*3, 0 );
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i, i+1, i+2 ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::float64array,control,preallocated,constructor', function benchmark( b ) {
- var offset;
- var arr;
- var buf;
- var i;
- var k;
-
- buf = new ArrayBuffer( b.iterations*8*3 ); // 8 bytes per double
- arr = new Float64Array( buf, b.iterations*8*3, 0 );
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- // Here, we are only testing the operation of creating a new view each time a value must be added to a typed array:
- k = 3 * (i+1);
- offset = arr.byteOffset - ( arr.BYTES_PER_ELEMENT*3 );
- arr = new Float64Array( arr.buffer, offset, k );
- if ( arr.length !== k ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::float64array,control,preallocated,constructor,value', function benchmark( b ) {
- var offset;
- var arr;
- var buf;
- var i;
- var j;
- var k;
-
- buf = new ArrayBuffer( b.iterations*8*3 ); // 8 bytes per double
- arr = new Float64Array( buf, b.iterations*8*3, 0 );
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- k = 3 * (i+1);
- offset = arr.byteOffset - ( arr.BYTES_PER_ELEMENT*3 );
- arr = new Float64Array( arr.buffer, offset, k );
- for ( j = 0; j < 3; j++ ) {
- arr[ j ] = i + j;
- }
- if ( arr.length !== k ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
diff --git a/benchmark/benchmark.typed_array.js b/benchmark/benchmark.typed_array.js
deleted file mode 100644
index c0de4d0..0000000
--- a/benchmark/benchmark.typed_array.js
+++ /dev/null
@@ -1,246 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var bench = require( '@stdlib/bench-harness' );
-var MAX_INT32 = require( '@stdlib/constants-int32-max' );
-var MAX_UINT32 = require( '@stdlib/constants-uint32-max' );
-var MAX_INT16 = require( '@stdlib/constants-int16-max' );
-var MAX_UINT16 = require( '@stdlib/constants-uint16-max' );
-var MAX_INT8 = require( '@stdlib/constants-int8-max' );
-var MAX_UINT8 = require( '@stdlib/constants-uint8-max' );
-var Float32Array = require( '@stdlib/array-float32' );
-var Float64Array = require( '@stdlib/array-float64' );
-var Int8Array = require( '@stdlib/array-int8' );
-var Int16Array = require( '@stdlib/array-int16' );
-var Int32Array = require( '@stdlib/array-int32' );
-var Uint8Array = require( '@stdlib/array-uint8' );
-var Uint8ClampedArray = require( '@stdlib/array-uint8c' );
-var Uint16Array = require( '@stdlib/array-uint16' );
-var Uint32Array = require( '@stdlib/array-uint32' );
-var pkg = require( './../package.json' ).name;
-var prepend = require( './../lib' );
-
-
-// MAIN //
-
-bench( pkg+'::float64array', function benchmark( b ) {
- var arr;
- var i;
-
- arr = new Float64Array();
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i, i+1, i+2 ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::float32array', function benchmark( b ) {
- var arr;
- var i;
-
- arr = new Float32Array();
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i, i+1, i+2 ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::int32array', function benchmark( b ) {
- var arr;
- var max;
- var i;
-
- max = MAX_INT32 + 1;
- arr = new Int32Array();
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i%max, (i+1)%max, (i+2)%max ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::uint32array', function benchmark( b ) {
- var arr;
- var max;
- var i;
-
- max = MAX_UINT32 + 1;
- arr = new Uint32Array();
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i%max, (i+1)%max, (i+2)%max ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::int16array', function benchmark( b ) {
- var arr;
- var max;
- var i;
-
- max = MAX_INT16 + 1;
- arr = new Int16Array();
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i%max, (i+1)%max, (i+2)%max ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::uint16array', function benchmark( b ) {
- var arr;
- var max;
- var i;
-
- max = MAX_UINT16 + 1;
- arr = new Uint16Array();
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i%max, (i+1)%max, (i+2)%max ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::int8array', function benchmark( b ) {
- var arr;
- var max;
- var i;
-
- max = MAX_INT8 + 1;
- arr = new Int8Array();
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i%max, (i+1)%max, (i+2)%max ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::uint8array', function benchmark( b ) {
- var arr;
- var max;
- var i;
-
- max = MAX_UINT8 + 1;
- arr = new Uint8Array();
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i%max, (i+1)%max, (i+2)%max ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( pkg+'::uint8clampedarray', function benchmark( b ) {
- var arr;
- var max;
- var i;
-
- max = MAX_UINT8 + 1;
- arr = new Uint8ClampedArray();
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- arr = prepend( arr, [ i%max, (i+1)%max, (i+2)%max ] );
- if ( arr.length !== 3*(i+1) ) {
- b.fail( 'should have added an element' );
- }
- }
- b.toc();
- if ( arr.length !== b.iterations*3 ) {
- b.fail( 'should have added elements' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
diff --git a/branches.md b/branches.md
deleted file mode 100644
index 7ab9b33..0000000
--- a/branches.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-# Branches
-
-This repository has the following branches:
-
-- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place.
-- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network).
-- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]).
-- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]).
-- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]).
-
-The following diagram illustrates the relationships among the above branches:
-
-```mermaid
-graph TD;
-A[stdlib]-->|generate standalone package|B;
-B[main] -->|productionize| C[production];
-C -->|bundle| D[esm];
-C -->|bundle| E[deno];
-C -->|bundle| F[umd];
-
-%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/utils/prepend"
-%% click B href "https://github.com/stdlib-js/utils-prepend/tree/main"
-%% click C href "https://github.com/stdlib-js/utils-prepend/tree/production"
-%% click D href "https://github.com/stdlib-js/utils-prepend/tree/esm"
-%% click E href "https://github.com/stdlib-js/utils-prepend/tree/deno"
-%% click F href "https://github.com/stdlib-js/utils-prepend/tree/umd"
-```
-
-[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/utils/prepend
-[production-url]: https://github.com/stdlib-js/utils-prepend/tree/production
-[deno-url]: https://github.com/stdlib-js/utils-prepend/tree/deno
-[deno-readme]: https://github.com/stdlib-js/utils-prepend/blob/deno/README.md
-[umd-url]: https://github.com/stdlib-js/utils-prepend/tree/umd
-[umd-readme]: https://github.com/stdlib-js/utils-prepend/blob/umd/README.md
-[esm-url]: https://github.com/stdlib-js/utils-prepend/tree/esm
-[esm-readme]: https://github.com/stdlib-js/utils-prepend/blob/esm/README.md
\ No newline at end of file
diff --git a/browser.js b/browser.js
new file mode 100644
index 0000000..b8aff7c
--- /dev/null
+++ b/browser.js
@@ -0,0 +1,3 @@
+// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
+var r,e;r=this,e=function(){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function e(){return r&&"symbol"==typeof Symbol.toStringTag}var n=Object.prototype.toString,t=Object.prototype.hasOwnProperty,i="function"==typeof Symbol?Symbol:void 0,o="function"==typeof i?i.toStringTag:"",a=e()?function(r){var e,i,a,u,f;if(null==r)return n.call(r);i=r[o],f=o,e=null!=(u=r)&&t.call(u,f);try{r[o]=void 0}catch(e){return n.call(r)}return a=n.call(r),e?r[o]=i:delete r[o],a}:function(r){return n.call(r)},u=Array.isArray?Array.isArray:function(r){return"[object Array]"===a(r)},f=Math.floor;function c(r){return f(r)===r}var s=9007199254740991,l="function"==typeof Object.defineProperty?Object.defineProperty:null,p=Object.defineProperty;function y(r){return"number"==typeof r}function g(r){var e,n="";for(e=0;e0&&(e-=1),n=t.toExponential(e)):n=t.toPrecision(r.precision),r.alternate||(n=E.call(n,x,"$1e"),n=E.call(n,I,"e"),n=E.call(n,U,""));break;default:throw new Error("invalid double notation. Value: "+r.specifier)}return n=E.call(n,_,"e+0$1"),n=E.call(n,j,"e-0$1"),r.alternate&&(n=E.call(n,S,"$1."),n=E.call(n,T,"$1.e")),t>=0&&r.sign&&(n=r.sign+n),n=r.specifier===A.call(r.specifier)?A.call(n):m.call(n)}function N(r){var e,n="";for(e=0;e127)throw new Error("invalid character code. Value: "+t.arg);t.arg=V(o)?String(t.arg):k(o)}break;case"e":case"E":case"f":case"F":case"g":case"G":e||(t.precision=6),t.arg=O(t);break;default:throw new Error("invalid specifier: "+t.specifier)}t.maxWidth>=0&&t.arg.length>t.maxWidth&&(t.arg=t.arg.substring(0,t.maxWidth)),t.padZeros?t.arg=h(t.arg,t.width||t.precision,t.padRight):t.width&&(t.arg=(s=t.arg,l=t.width,p=t.padRight,y=void 0,(y=l-s.length)<0?s:s=p?s+N(y):N(y)+s)),a+=t.arg||"",u+=1}return a}var B=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function R(r){var e={mapping:r[1]?parseInt(r[1],10):void 0,flags:r[2],width:r[3],precision:r[5],specifier:r[6]};return"."===r[4]&&void 0===r[5]&&(e.precision="1"),e}function W(r){var e,n,t,i;for(n=[],i=0,t=B.exec(r);t;)(e=r.slice(i,B.lastIndex-t[0].length)).length&&n.push(e),n.push(R(t)),i=B.lastIndex,t=B.exec(r);return(e=r.slice(i)).length&&n.push(e),n}function $(r){var e,n;if("string"!=typeof r)throw new TypeError($("invalid argument. First argument must be a string. Value: `%s`.",r));for(e=[W(r)],n=1;nnr&&c(r)}function ir(r){return z(r)&&tr(r)}function or(r){return Q(r)&&tr(r.valueOf())}function ar(r){return ir(r)||or(r)}function ur(r){return ir(r)&&r>=0}function fr(r){return or(r)&&r.valueOf()>=0}function cr(r){return ur(r)||fr(r)}function sr(){var r,e=arguments,n="https://stdlib.io/e/"+e[0]+"?";for(r=1;r0?r-1:r+1)}var Sr=Math.sqrt;function Tr(r){return Math.abs(r)}var Ur,Ir="function"==typeof Uint32Array,xr="function"==typeof Uint32Array?Uint32Array:null,Or="function"==typeof Uint32Array?Uint32Array:void 0;Ur=function(){var r,e,n;if("function"!=typeof xr)return!1;try{e=new xr(e=[1,3.14,-3.14,4294967296,4294967297]),n=e,r=(Ir&&n instanceof Uint32Array||"[object Uint32Array]"===a(n))&&1===e[0]&&3===e[1]&&4294967293===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?Or:function(){throw new Error("not implemented")};var Nr,kr=Ur,Fr="function"==typeof Uint8Array,Vr="function"==typeof Uint8Array?Uint8Array:null,Lr="function"==typeof Uint8Array?Uint8Array:void 0;Nr=function(){var r,e,n;if("function"!=typeof Vr)return!1;try{e=new Vr(e=[1,3.14,-3.14,256,257]),n=e,r=(Fr&&n instanceof Uint8Array||"[object Uint8Array]"===a(n))&&1===e[0]&&3===e[1]&&253===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?Lr:function(){throw new Error("not implemented")};var Pr,Br=Nr,Rr="function"==typeof Uint16Array,Wr="function"==typeof Uint16Array?Uint16Array:null,$r="function"==typeof Uint16Array?Uint16Array:void 0;Pr=function(){var r,e,n;if("function"!=typeof Wr)return!1;try{e=new Wr(e=[1,3.14,-3.14,65536,65537]),n=e,r=(Rr&&n instanceof Uint16Array||"[object Uint16Array]"===a(n))&&1===e[0]&&3===e[1]&&65533===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?$r:function(){throw new Error("not implemented")};var Gr,Cr={uint16:Pr,uint8:Br};(Gr=new Cr.uint16(1))[0]=4660;var Hr,Mr,Yr=52===new Cr.uint8(Gr.buffer)[0];!0===Yr?(Hr=1,Mr=0):(Hr=0,Mr=1);var Zr={HIGH:Hr,LOW:Mr},Xr=new vr(1),qr=new kr(Xr.buffer),zr=Zr.HIGH,Dr=Zr.LOW;function Jr(r,e,n,t){return Xr[0]=r,e[t]=qr[zr],e[t+n]=qr[Dr],e}function Kr(r){return Jr(r,[0,0],1,0)}q(Kr,"assign",Jr);var Qr=!0===Yr?0:1,re=new vr(1),ee=new kr(re.buffer);function ne(r,e){return re[0]=r,ee[Qr]=e>>>0,re[0]}function te(r){return 0|r}var ie,oe,ae=2147483647,ue=2147483648,fe=!0===Yr?1:0,ce=new vr(1),se=new kr(ce.buffer);function le(r){return ce[0]=r,se[fe]}!0===Yr?(ie=1,oe=0):(ie=0,oe=1);var pe={HIGH:ie,LOW:oe},ye=new vr(1),ge=new kr(ye.buffer),he=pe.HIGH,de=pe.LOW;function ve(r,e){return ge[he]=r,ge[de]=e,ye[0]}var be=[0,0];function we(r,e){var n,t;return Kr.assign(r,be,1,0),n=be[0],n&=ae,t=le(e),ve(n|=t&=ue,be[1])}var me=1072693247,Ae=1e300,Ee=1e-300,_e=!0===Yr?1:0,je=new vr(1),Se=new kr(je.buffer);function Te(r,e){return je[0]=r,Se[_e]=e>>>0,je[0]}var Ue=1023,Ie=1048575,xe=1048576,Oe=1072693248,Ne=536870912,ke=524288,Fe=20,Ve=9007199254740992,Le=.9617966939259756,Pe=.9617967009544373,Be=-7.028461650952758e-9,Re=[1,1.5],We=[0,.5849624872207642],$e=[0,1.350039202129749e-8],Ge=1.4426950408889634,Ce=1.4426950216293335,He=1.9259629911266175e-8,Me=1023,Ye=-1023,Ze=-1074,Xe=22250738585072014e-324,qe=4503599627370496;function ze(r,e,n,t){return Ar(r)||Er(r)?(e[t]=r,e[t+n]=0,e):0!==r&&Tr(r)>>20)-Ue|0}(r),eMe?r<0?nr:er:(e<=Ye?(e+=52,t=Je):t=1,Kr.assign(r,rn,1,0),n=rn[0],n&=Ke,t*ve(n|=e+Ue<<20,rn[1])))}var nn=.6931471805599453,tn=1048575,on=1048576,an=1071644672,un=20,fn=.6931471824645996,cn=-1.904654299957768e-9,sn=1072693247,ln=1105199104,pn=1139802112,yn=1083179008,gn=1072693248,hn=1083231232,dn=3230714880,vn=31,bn=1e300,wn=1e-300,mn=8008566259537294e-32,An=[0,0],En=[0,0];function _n(r,e){var n,t,i,o,a,u,f,s,l,p,y,g,h,d;if(Ar(r)||Ar(e))return NaN;if(Kr.assign(e,An,1,0),a=An[0],0===An[1]){if(0===e)return 1;if(1===e)return r;if(-1===e)return 1/r;if(.5===e)return Sr(r);if(-.5===e)return 1/Sr(r);if(2===e)return r*r;if(3===e)return r*r*r;if(4===e)return(r*=r)*r;if(Er(e))return function(r,e){return-1===r?(r-r)/(r-r):1===r?1:Tr(r)<1==(e===er)?0:er}(r,e)}if(Kr.assign(r,An,1,0),o=An[0],0===An[1]){if(0===o)return function(r,e){return e===nr?er:e===er?0:e>0?jr(e)?r:0:jr(e)?we(er,r):er}(r,e);if(1===r)return 1;if(-1===r&&jr(e))return-1;if(Er(r))return r===nr?_n(-0,-e):e<0?0:er}if(r<0&&!1===c(e))return(r-r)/(r-r);if(i=Tr(r),n=o&ae|0,t=a&ae|0,f=a>>>vn|0,u=(u=o>>>vn|0)&&jr(e)?-1:1,t>ln){if(t>pn)return function(r,e){return(le(r)&ae)<=me?e<0?Ae*Ae:Ee*Ee:e>0?Ae*Ae:Ee*Ee}(r,e);if(ngn)return 0===f?u*bn*bn:u*wn*wn;y=function(r,e){var n,t,i,o,a,u,f;return o=(i=e-1)*i*(0===(f=i)?.5:.5+f*(.25*f-.3333333333333333)),n=(u=i*He-o*Ge)-((t=ne(t=(a=Ce*i)+u,0))-a),r[0]=t,r[1]=n,r}(En,i)}else y=function(r,e,n){var t,i,o,a,u,f,c,s,l,p,y,g,h,d,v,b,w,m,A,E,_;return m=0,n>Fe)-Ue|0,n=(A=n&Ie|0)|Oe|0,A<=235662?E=0:A<767610?E=1:(E=0,m+=1,n-=xe),a=ne(i=(b=(e=Te(e,n))-(c=Re[E]))*(w=1/(e+c)),0),t=(n>>1|Ne)+ke,f=Te(0,t+=E<<18),v=(o=i*i)*o*(0===(_=o)?.5999999999999946:.5999999999999946+_*(.4285714285785502+_*(.33333332981837743+_*(.272728123808534+_*(.23066074577556175+.20697501780033842*_))))),f=ne(f=3+(o=a*a)+(v+=(u=w*(b-a*f-a*(e-(f-c))))*(a+i)),0),l=ne(l=(b=a*f)+(w=u*f+(v-(f-3-o))*i),0),p=Pe*l,h=(y=Be*l+(w-(l-b))*Le+$e[E])-((g=ne(g=p+y+(s=We[E])+(d=m),0))-d-s-p),r[0]=g,r[1]=h,r}(En,i,n);if(g=(p=(e-(s=ne(e,0)))*y[0]+e*y[1])+(l=s*y[0]),Kr.assign(g,An,1,0),h=te(An[0]),d=te(An[1]),h>=yn){if(0!=(h-yn|d))return u*bn*bn;if(p+mn>g-l)return u*bn*bn}else if((h&ae)>=hn){if(0!=(h-dn|d))return u*wn*wn;if(p<=g-l)return u*wn*wn}return g=function(r,e,n){var t,i,o,a,u,f,c,s,l,p;return l=((s=r&ae|0)>>un)-Ue|0,c=0,s>an&&(i=Te(0,((c=r+(on>>l+1)>>>0)&~(tn>>(l=((c&ae)>>un)-Ue|0)))>>>0),c=(c&tn|on)>>un-l>>>0,r<0&&(c=-c),e-=i),r=te(r=le(f=1-((f=(o=(i=ne(i=n+e,0))*fn)+(a=(n-(i-e))*nn+i*cn))*(t=f-(i=f*f)*(0===(p=i)?.16666666666666602:.16666666666666602+p*(p*(6613756321437934e-20+p*(4.1381367970572385e-8*p-16533902205465252e-22))-.0027777777777015593)))/(t-2)-((u=a-(f-o))+f*u)-f))),(r+=c<>>0)>>un<=0?en(f,c):Te(f,r)}(h,l,p),u*g}var jn=Math.ceil,Sn=0x40000000000000,Tn=1.4426950407214463,Un=1.6751713164886512e-10,In=2146435072,xn=1048576,On=1072693248,Nn=[0,0];function kn(r){var e,n;return Ar(r)||Er(r)||0===r?r:(r<0?(r=-r,e=-1):e=1,n=function(r){var e,n,t,i,o,a,u,f,c,s,l,p,y;if(Ar(r)||r<0)return NaN;if(Kr.assign(r,Nn,1,0),i=Nn[0],o=Nn[1],y=0,i=In?r+r:i===On&&0===o?0:(y+=(i>>20)-Ue|0,l=y+=(p=614244+(i&=tn)&xn|0)>>20|0,t=.5*(f=(r=Te(r,i|p^On))-1)*f,c=function(r){var e,n,t,i,o,a;return e=(o=(i=(t=r/(2+r))*t)*i)*(0===(a=o)?.3999999999940942:.3999999999940942+a*(.22222198432149784+.15313837699209373*a)),n=i*function(r){return 0===r?.6666666666666735:.6666666666666735+r*(.2857142874366239+r*(.1818357216161805+.14798198605116586*r))}(o),t*(.5*r*r+(n+e))}(f),n=((u=f-(a=ne(a=f-t,0))-t+c)+a)*Un+u*Tn,(n+=l-(s=l+(e=a*Tn))+e)+(e=s))}(r),n===Ze?r:(n=-1===e?f(n):jn(n))>Me?er:e*_n(2,n))}return function(r,e){if(!("object"==typeof(n=e)&&null!==n&&"number"==typeof n.length&&c(n.length)&&n.length>=0&&n.length<=s))throw new TypeError(sr("1Wn2y",e));var n;if(u(r))return function(r,e){var n;for(n=e.length-1;n>=0;n--)r.unshift(e[n]);return r}(r,e);if(function(r){return null!==r&&"object"==typeof r&&ur(r.length)&&r.length<=s&&"number"==typeof r.BYTES_PER_ELEMENT&&"number"==typeof r.byteOffset&&"number"==typeof r.byteLength}(r))return function(r,e){var n,t,i,o,a,u,f,c;if(o=r.length,t=(u=e.length)*r.BYTES_PER_ELEMENT,(i=r.byteOffset)=0)return function(r,e){var n,t,i;for(n=r.length,t=e.length,i=n-1;i>=0;i--)r[i+t]=r[i];for(i=0;i\n*/\nfunction hasToStringTagSupport() {\n\treturn ( FLG && typeof Symbol.toStringTag === 'symbol' );\n}\n\n\n// EXPORTS //\n\nexport default hasToStringTagSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests for native `Symbol` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol` support\n*\n* @example\n* var bool = hasSymbolSupport();\n* // returns \n*/\nfunction hasSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasSymbolSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar toStr = Object.prototype.toString;\n\n\n// EXPORTS //\n\nexport default toStr;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\nvar has = Object.prototype.hasOwnProperty;\n\n\n// MAIN //\n\n/**\n* Tests if an object has a specified property.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object has a specified property\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'bap' );\n* // returns false\n*/\nfunction hasOwnProp( value, property ) {\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\treturn has.call( value, property );\n}\n\n\n// EXPORTS //\n\nexport default hasOwnProp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar Sym = ( typeof Symbol === 'function' ) ? Symbol : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Sym;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Symbol from '@stdlib/symbol-ctor';\n\n\n// MAIN //\n\nvar toStrTag = ( typeof Symbol === 'function' ) ? Symbol.toStringTag : '';\n\n\n// EXPORTS //\n\nexport default toStrTag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a string value indicating a specification defined classification of an object.\n*\n* @module @stdlib/utils-native-class\n*\n* @example\n* import nativeClass from '@stdlib/utils-native-class';\n*\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* function Beep() {\n* return this;\n* }\n* str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main;\nif ( hasToStringTag() ) {\n\tmain = polyfill;\n} else {\n\tmain = builtin;\n}\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport toStringTag from './tostringtag.js';\nimport toStr from './tostring.js';\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification of an object in environments supporting `Symbol.toStringTag`.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\tvar isOwn;\n\tvar tag;\n\tvar out;\n\n\tif ( v === null || v === void 0 ) {\n\t\treturn toStr.call( v );\n\t}\n\ttag = v[ toStringTag ];\n\tisOwn = hasOwnProp( v, toStringTag );\n\n\t// Attempt to override the `toStringTag` property. For built-ins having a `Symbol.toStringTag` property (e.g., `JSON`, `Math`, etc), the `Symbol.toStringTag` property is read-only (e.g., , so we need to wrap in a `try/catch`.\n\ttry {\n\t\tv[ toStringTag ] = void 0;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn toStr.call( v );\n\t}\n\tout = toStr.call( v );\n\n\tif ( isOwn ) {\n\t\tv[ toStringTag ] = tag;\n\t} else {\n\t\tdelete v[ toStringTag ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default nativeClass;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toStr from './tostring.js';\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification (via the internal property `[[Class]]`) of an object.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\treturn toStr.call( v );\n}\n\n\n// EXPORTS //\n\nexport default nativeClass;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar f;\n\n\n// FUNCTIONS //\n\n/**\n* Tests if a value is an array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an array\n*\n* @example\n* var bool = isArray( [] );\n* // returns true\n*\n* @example\n* var bool = isArray( {} );\n* // returns false\n*/\nfunction isArray( value ) {\n\treturn ( nativeClass( value ) === '[object Array]' );\n}\n\n\n// MAIN //\n\nif ( Array.isArray ) {\n\tf = Array.isArray;\n} else {\n\tf = isArray;\n}\n\n\n// EXPORTS //\n\nexport default f;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward negative infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = floor( -4.2 );\n* // returns -5.0\n*\n* @example\n* var v = floor( 9.99999 );\n* // returns 9.0\n*\n* @example\n* var v = floor( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = floor( NaN );\n* // returns NaN\n*/\nvar floor = Math.floor; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default floor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport floor from '@stdlib/math-base-special-floor';\n\n\n// MAIN //\n\n/**\n* Tests if a finite double-precision floating-point number is an integer.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an integer\n*\n* @example\n* var bool = isInteger( 1.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( 3.14 );\n* // returns false\n*/\nfunction isInteger( x ) {\n\treturn (floor(x) === x);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum length of a typed array.\n*\n* @module @stdlib/constants-array-max-typed-array-length\n*\n* @example\n* import MAX_TYPED_ARRAY_LENGTH from '@stdlib/constants-array-max-typed-array-length';\n* // returns 9007199254740991\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a typed array.\n*\n* ```tex\n* 2^{53} - 1\n* ```\n*\n* @constant\n* @type {number}\n* @default 9007199254740991\n*/\nvar MAX_TYPED_ARRAY_LENGTH = 9007199254740991;\n\n\n// EXPORTS //\n\nexport default MAX_TYPED_ARRAY_LENGTH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Object.defineProperty === 'function' ) ? Object.defineProperty : null;\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @name defineProperty\n* @type {Function}\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nvar defineProperty = Object.defineProperty;\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( typeof value === 'number' ); // NOTE: we inline the `isNumber.isPrimitive` function from `@stdlib/assert/is-number` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Tests if a string starts with a minus sign (`-`).\n*\n* @private\n* @param {string} str - input string\n* @returns {boolean} boolean indicating if a string starts with a minus sign (`-`)\n*/\nfunction startsWithMinus( str ) {\n\treturn str[ 0 ] === '-';\n}\n\n/**\n* Returns a string of `n` zeros.\n*\n* @private\n* @param {number} n - number of zeros\n* @returns {string} string of zeros\n*/\nfunction zeros( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += '0';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with zeros to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction zeroPad( str, width, right ) {\n\tvar negative = false;\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tif ( startsWithMinus( str ) ) {\n\t\tnegative = true;\n\t\tstr = str.substr( 1 );\n\t}\n\tstr = ( right ) ?\n\t\tstr + zeros( pad ) :\n\t\tzeros( pad ) + str;\n\tif ( negative ) {\n\t\tstr = '-' + str;\n\t}\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default zeroPad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNumber from './is_number.js';\nimport zeroPad from './zero_pad.js';\n\n// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.\nvar lowercase = String.prototype.toLowerCase;\nvar uppercase = String.prototype.toUpperCase;\n\n\n// MAIN //\n\n/**\n* Formats a token object argument as an integer.\n*\n* @private\n* @param {Object} token - token object\n* @throws {Error} must provide a valid integer\n* @returns {string} formatted token argument\n*/\nfunction formatInteger( token ) {\n\tvar base;\n\tvar out;\n\tvar i;\n\n\tswitch ( token.specifier ) {\n\tcase 'b':\n\t\t// Case: %b (binary)\n\t\tbase = 2;\n\t\tbreak;\n\tcase 'o':\n\t\t// Case: %o (octal)\n\t\tbase = 8;\n\t\tbreak;\n\tcase 'x':\n\tcase 'X':\n\t\t// Case: %x, %X (hexadecimal)\n\t\tbase = 16;\n\t\tbreak;\n\tcase 'd':\n\tcase 'i':\n\tcase 'u':\n\tdefault:\n\t\t// Case: %d, %i, %u (decimal)\n\t\tbase = 10;\n\t\tbreak;\n\t}\n\tout = token.arg;\n\ti = parseInt( out, 10 );\n\tif ( !isFinite( i ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\tif ( !isNumber( out ) ) {\n\t\t\tthrow new Error( 'invalid integer. Value: ' + out );\n\t\t}\n\t\ti = 0;\n\t}\n\tif ( i < 0 && ( token.specifier === 'u' || base !== 10 ) ) {\n\t\ti = 0xffffffff + i + 1;\n\t}\n\tif ( i < 0 ) {\n\t\tout = ( -i ).toString( base );\n\t\tif ( token.precision ) {\n\t\t\tout = zeroPad( out, token.precision, token.padRight );\n\t\t}\n\t\tout = '-' + out;\n\t} else {\n\t\tout = i.toString( base );\n\t\tif ( !i && !token.precision ) {\n\t\t\tout = '';\n\t\t} else if ( token.precision ) {\n\t\t\tout = zeroPad( out, token.precision, token.padRight );\n\t\t}\n\t\tif ( token.sign ) {\n\t\t\tout = token.sign + out;\n\t\t}\n\t}\n\tif ( base === 16 ) {\n\t\tif ( token.alternate ) {\n\t\t\tout = '0x' + out;\n\t\t}\n\t\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\t\tuppercase.call( out ) :\n\t\t\tlowercase.call( out );\n\t}\n\tif ( base === 8 ) {\n\t\tif ( token.alternate && out.charAt( 0 ) !== '0' ) {\n\t\t\tout = '0' + out;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNumber from './is_number.js';\n\n// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.\nvar abs = Math.abs; // eslint-disable-line stdlib/no-builtin-math\nvar lowercase = String.prototype.toLowerCase;\nvar uppercase = String.prototype.toUpperCase;\nvar replace = String.prototype.replace;\n\n\n// VARIABLES //\n\nvar RE_EXP_POS_DIGITS = /e\\+(\\d)$/;\nvar RE_EXP_NEG_DIGITS = /e-(\\d)$/;\nvar RE_ONLY_DIGITS = /^(\\d+)$/;\nvar RE_DIGITS_BEFORE_EXP = /^(\\d+)e/;\nvar RE_TRAILING_PERIOD_ZERO = /\\.0$/;\nvar RE_PERIOD_ZERO_EXP = /\\.0*e/;\nvar RE_ZERO_BEFORE_EXP = /(\\..*[^0])0*e/;\n\n\n// MAIN //\n\n/**\n* Formats a token object argument as a floating-point number.\n*\n* @private\n* @param {Object} token - token object\n* @throws {Error} must provide a valid floating-point number\n* @returns {string} formatted token argument\n*/\nfunction formatDouble( token ) {\n\tvar digits;\n\tvar out;\n\tvar f = parseFloat( token.arg );\n\tif ( !isFinite( f ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\tif ( !isNumber( token.arg ) ) {\n\t\t\tthrow new Error( 'invalid floating-point number. Value: ' + out );\n\t\t}\n\t\t// Case: NaN, Infinity, or -Infinity\n\t\tf = token.arg;\n\t}\n\tswitch ( token.specifier ) {\n\tcase 'e':\n\tcase 'E':\n\t\tout = f.toExponential( token.precision );\n\t\tbreak;\n\tcase 'f':\n\tcase 'F':\n\t\tout = f.toFixed( token.precision );\n\t\tbreak;\n\tcase 'g':\n\tcase 'G':\n\t\tif ( abs( f ) < 0.0001 ) {\n\t\t\tdigits = token.precision;\n\t\t\tif ( digits > 0 ) {\n\t\t\t\tdigits -= 1;\n\t\t\t}\n\t\t\tout = f.toExponential( digits );\n\t\t} else {\n\t\t\tout = f.toPrecision( token.precision );\n\t\t}\n\t\tif ( !token.alternate ) {\n\t\t\tout = replace.call( out, RE_ZERO_BEFORE_EXP, '$1e' );\n\t\t\tout = replace.call( out, RE_PERIOD_ZERO_EXP, 'e' );\n\t\t\tout = replace.call( out, RE_TRAILING_PERIOD_ZERO, '' );\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tthrow new Error( 'invalid double notation. Value: ' + token.specifier );\n\t}\n\tout = replace.call( out, RE_EXP_POS_DIGITS, 'e+0$1' );\n\tout = replace.call( out, RE_EXP_NEG_DIGITS, 'e-0$1' );\n\tif ( token.alternate ) {\n\t\tout = replace.call( out, RE_ONLY_DIGITS, '$1.' );\n\t\tout = replace.call( out, RE_DIGITS_BEFORE_EXP, '$1.e' );\n\t}\n\tif ( f >= 0 && token.sign ) {\n\t\tout = token.sign + out;\n\t}\n\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\tuppercase.call( out ) :\n\t\tlowercase.call( out );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatDouble;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Returns `n` spaces.\n*\n* @private\n* @param {number} n - number of spaces\n* @returns {string} string of spaces\n*/\nfunction spaces( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += ' ';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with spaces to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction spacePad( str, width, right ) {\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tstr = ( right ) ?\n\t\tstr + spaces( pad ) :\n\t\tspaces( pad ) + str;\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default spacePad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport formatInteger from './format_integer.js';\nimport isString from './is_string.js';\nimport formatDouble from './format_double.js';\nimport spacePad from './space_pad.js';\nimport zeroPad from './zero_pad.js';\n\n\n// VARIABLES //\n\nvar fromCharCode = String.fromCharCode;\nvar isArray = Array.isArray; // NOTE: We use the global `Array.isArray` function here instead of `@stdlib/assert/is-array` to avoid circular dependencies.\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating whether a value is `NaN`.\n*\n* @private\n* @param {*} value - input value\n* @returns {boolean} boolean indicating whether a value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 4 );\n* // returns false\n*/\nfunction isnan( value ) { // explicitly define a function here instead of `@stdlib/math/base/assert/is-nan` in order to avoid circular dependencies\n\treturn ( value !== value );\n}\n\n/**\n* Initializes token object with properties of supplied format identifier object or default values if not present.\n*\n* @private\n* @param {Object} token - format identifier object\n* @returns {Object} token object\n*/\nfunction initialize( token ) {\n\tvar out = {};\n\tout.specifier = token.specifier;\n\tout.precision = ( token.precision === void 0 ) ? 1 : token.precision;\n\tout.width = token.width;\n\tout.flags = token.flags || '';\n\tout.mapping = token.mapping;\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates string from a token array by interpolating values.\n*\n* @param {Array} tokens - string parts and format identifier objects\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be an array\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var tokens = [ 'beep ', { 'specifier': 's' } ];\n* var out = formatInterpolate( tokens, 'boop' );\n* // returns 'beep boop'\n*/\nfunction formatInterpolate( tokens ) {\n\tvar hasPeriod;\n\tvar flags;\n\tvar token;\n\tvar flag;\n\tvar num;\n\tvar out;\n\tvar pos;\n\tvar i;\n\tvar j;\n\n\tif ( !isArray( tokens ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be an array. Value: `' + tokens + '`.' );\n\t}\n\tout = '';\n\tpos = 1;\n\tfor ( i = 0; i < tokens.length; i++ ) {\n\t\ttoken = tokens[ i ];\n\t\tif ( isString( token ) ) {\n\t\t\tout += token;\n\t\t} else {\n\t\t\thasPeriod = token.precision !== void 0;\n\t\t\ttoken = initialize( token );\n\t\t\tif ( !token.specifier ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. Token is missing `specifier` property. Index: `'+ i +'`. Value: `' + token + '`.' );\n\t\t\t}\n\t\t\tif ( token.mapping ) {\n\t\t\t\tpos = token.mapping;\n\t\t\t}\n\t\t\tflags = token.flags;\n\t\t\tfor ( j = 0; j < flags.length; j++ ) {\n\t\t\t\tflag = flags.charAt( j );\n\t\t\t\tswitch ( flag ) {\n\t\t\t\tcase ' ':\n\t\t\t\t\ttoken.sign = ' ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+':\n\t\t\t\t\ttoken.sign = '+';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '0':\n\t\t\t\t\ttoken.padZeros = flags.indexOf( '-' ) < 0; // NOTE: We use built-in `Array.prototype.indexOf` here instead of `@stdlib/assert/contains` in order to avoid circular dependencies.\n\t\t\t\t\tbreak;\n\t\t\t\tcase '#':\n\t\t\t\t\ttoken.alternate = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'invalid flag: ' + flag );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( token.width === '*' ) {\n\t\t\t\ttoken.width = parseInt( arguments[ pos ], 10 );\n\t\t\t\tpos += 1;\n\t\t\t\tif ( isnan( token.width ) ) {\n\t\t\t\t\tthrow new TypeError( 'the argument for * width at position ' + pos + ' is not a number. Value: `' + token.width + '`.' );\n\t\t\t\t}\n\t\t\t\tif ( token.width < 0 ) {\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.width = -token.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( hasPeriod ) {\n\t\t\t\tif ( token.precision === '*' ) {\n\t\t\t\t\ttoken.precision = parseInt( arguments[ pos ], 10 );\n\t\t\t\t\tpos += 1;\n\t\t\t\t\tif ( isnan( token.precision ) ) {\n\t\t\t\t\t\tthrow new TypeError( 'the argument for * precision at position ' + pos + ' is not a number. Value: `' + token.precision + '`.' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( token.precision < 0 ) {\n\t\t\t\t\t\ttoken.precision = 1;\n\t\t\t\t\t\thasPeriod = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoken.arg = arguments[ pos ];\n\t\t\tswitch ( token.specifier ) {\n\t\t\tcase 'b':\n\t\t\tcase 'o':\n\t\t\tcase 'x':\n\t\t\tcase 'X':\n\t\t\tcase 'd':\n\t\t\tcase 'i':\n\t\t\tcase 'u':\n\t\t\t\t// Case: %b (binary), %o (octal), %x, %X (hexadecimal), %d, %i (decimal), %u (unsigned decimal)\n\t\t\t\tif ( hasPeriod ) {\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatInteger( token );\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t// Case: %s (string)\n\t\t\t\ttoken.maxWidth = ( hasPeriod ) ? token.precision : -1;\n\t\t\t\ttoken.arg = String( token.arg );\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t// Case: %c (character)\n\t\t\t\tif ( !isnan( token.arg ) ) {\n\t\t\t\t\tnum = parseInt( token.arg, 10 );\n\t\t\t\t\tif ( num < 0 || num > 127 ) {\n\t\t\t\t\t\tthrow new Error( 'invalid character code. Value: ' + token.arg );\n\t\t\t\t\t}\n\t\t\t\t\ttoken.arg = ( isnan( num ) ) ? String( token.arg ) : fromCharCode( num ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\tcase 'g':\n\t\t\tcase 'G':\n\t\t\t\t// Case: %e, %E (scientific notation), %f, %F (decimal floating point), %g, %G (uses the shorter of %e/E or %f/F)\n\t\t\t\tif ( !hasPeriod ) {\n\t\t\t\t\ttoken.precision = 6;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatDouble( token );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'invalid specifier: ' + token.specifier );\n\t\t\t}\n\t\t\t// Fit argument into field width...\n\t\t\tif ( token.maxWidth >= 0 && token.arg.length > token.maxWidth ) {\n\t\t\t\ttoken.arg = token.arg.substring( 0, token.maxWidth );\n\t\t\t}\n\t\t\tif ( token.padZeros ) {\n\t\t\t\ttoken.arg = zeroPad( token.arg, token.width || token.precision, token.padRight ); // eslint-disable-line max-len\n\t\t\t} else if ( token.width ) {\n\t\t\t\ttoken.arg = spacePad( token.arg, token.width, token.padRight );\n\t\t\t}\n\t\t\tout += token.arg || '';\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInterpolate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar RE = /%(?:([1-9]\\d*)\\$)?([0 +\\-#]*)(\\*|\\d+)?(?:(\\.)(\\*|\\d+)?)?[hlL]?([%A-Za-z])/g;\n\n\n// FUNCTIONS //\n\n/**\n* Parses a delimiter.\n*\n* @private\n* @param {Array} match - regular expression match\n* @returns {Object} delimiter token object\n*/\nfunction parse( match ) {\n\tvar token = {\n\t\t'mapping': ( match[ 1 ] ) ? parseInt( match[ 1 ], 10 ) : void 0,\n\t\t'flags': match[ 2 ],\n\t\t'width': match[ 3 ],\n\t\t'precision': match[ 5 ],\n\t\t'specifier': match[ 6 ]\n\t};\n\tif ( match[ 4 ] === '.' && match[ 5 ] === void 0 ) {\n\t\ttoken.precision = '1';\n\t}\n\treturn token;\n}\n\n\n// MAIN //\n\n/**\n* Tokenizes a string into an array of string parts and format identifier objects.\n*\n* @param {string} str - input string\n* @returns {Array} tokens\n*\n* @example\n* var tokens = formatTokenize( 'Hello %s!' );\n* // returns [ 'Hello ', {...}, '!' ]\n*/\nfunction formatTokenize( str ) {\n\tvar content;\n\tvar tokens;\n\tvar match;\n\tvar prev;\n\n\ttokens = [];\n\tprev = 0;\n\tmatch = RE.exec( str );\n\twhile ( match ) {\n\t\tcontent = str.slice( prev, RE.lastIndex - match[ 0 ].length );\n\t\tif ( content.length ) {\n\t\t\ttokens.push( content );\n\t\t}\n\t\ttokens.push( parse( match ) );\n\t\tprev = RE.lastIndex;\n\t\tmatch = RE.exec( str );\n\t}\n\tcontent = str.slice( prev );\n\tif ( content.length ) {\n\t\ttokens.push( content );\n\t}\n\treturn tokens;\n}\n\n\n// EXPORTS //\n\nexport default formatTokenize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport interpolate from '@stdlib/string-base-format-interpolate';\nimport tokenize from '@stdlib/string-base-format-tokenize';\nimport isString from './is_string.js';\n\n\n// MAIN //\n\n/**\n* Inserts supplied variable values into a format string.\n*\n* @param {string} str - input string\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be a string\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var str = format( 'Hello %s!', 'world' );\n* // returns 'Hello world!'\n*\n* @example\n* var str = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\nfunction format( str ) {\n\tvar args;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\targs = [ tokenize( str ) ];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn interpolate.apply( null, args );\n}\n\n\n// EXPORTS //\n\nexport default format;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, no-proto */\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar objectProtoype = Object.prototype;\nvar toStr = objectProtoype.toString;\nvar defineGetter = objectProtoype.__defineGetter__;\nvar defineSetter = objectProtoype.__defineSetter__;\nvar lookupGetter = objectProtoype.__lookupGetter__;\nvar lookupSetter = objectProtoype.__lookupSetter__;\n\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @param {Object} obj - object on which to define the property\n* @param {string} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nfunction defineProperty( obj, prop, descriptor ) {\n\tvar prototype;\n\tvar hasValue;\n\tvar hasGet;\n\tvar hasSet;\n\n\tif ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', descriptor ) );\n\t}\n\thasValue = ( 'value' in descriptor );\n\tif ( hasValue ) {\n\t\tif (\n\t\t\tlookupGetter.call( obj, prop ) ||\n\t\t\tlookupSetter.call( obj, prop )\n\t\t) {\n\t\t\t// Override `__proto__` to avoid touching inherited accessors:\n\t\t\tprototype = obj.__proto__;\n\t\t\tobj.__proto__ = objectProtoype;\n\n\t\t\t// Delete property as existing getters/setters prevent assigning value to specified property:\n\t\t\tdelete obj[ prop ];\n\t\t\tobj[ prop ] = descriptor.value;\n\n\t\t\t// Restore original prototype:\n\t\t\tobj.__proto__ = prototype;\n\t\t} else {\n\t\t\tobj[ prop ] = descriptor.value;\n\t\t}\n\t}\n\thasGet = ( 'get' in descriptor );\n\thasSet = ( 'set' in descriptor );\n\n\tif ( hasValue && ( hasGet || hasSet ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );\n\t}\n\n\tif ( hasGet && defineGetter ) {\n\t\tdefineGetter.call( obj, prop, descriptor.get );\n\t}\n\tif ( hasSet && defineSetter ) {\n\t\tdefineSetter.call( obj, prop, descriptor.set );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define (or modify) an object property.\n*\n* @module @stdlib/utils-define-property\n*\n* @example\n* import defineProperty from '@stdlib/utils-define-property';\n*\n* var obj = {};\n* defineProperty( obj, 'foo', {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': false\n* });\n* obj.foo = 'boop'; // => throws\n*/\n\n// MODULES //\n\nimport hasDefinePropertySupport from './has_define_property_support.js';\nimport builtin from './builtin.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar defineProperty;\nif ( hasDefinePropertySupport() ) {\n\tdefineProperty = builtin;\n} else {\n\tdefineProperty = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from './define_property.js';\n\n\n// MAIN //\n\n/**\n* Tests for `Object.defineProperty` support.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support\n*\n* @example\n* var bool = hasDefinePropertySupport();\n* // returns \n*/\nfunction hasDefinePropertySupport() {\n\t// Test basic support...\n\ttry {\n\t\tdefineProperty( {}, 'x', {} );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default hasDefinePropertySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( typeof value === 'number' );\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// EXPORTS //\n\nexport default Number; // eslint-disable-line stdlib/require-globals\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar toString = Number.prototype.toString; // non-generic\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport nativeClass from '@stdlib/utils-native-class';\nimport Number from '@stdlib/number-ctor';\nimport test from './try2serialize.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\nfunction isNumber( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof Number ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object Number]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toString from './tostring.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to serialize a value to a string.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value can be serialized\n*/\nfunction test( value ) {\n\ttry {\n\t\ttoString.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a number\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( null );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a number.\n*\n* @module @stdlib/assert-is-number\n*\n* @example\n* import isNumber from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNumber } from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNumber } from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* @module @stdlib/constants-float64-pinf\n* @type {number}\n*\n* @example\n* import FLOAT64_PINF from '@stdlib/constants-float64-pinf';\n* // returns Infinity\n*/\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point positive infinity has the bit sequence\n*\n* ```binarystring\n* 0 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.POSITIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_PINF = Number.POSITIVE_INFINITY; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default FLOAT64_PINF;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* @module @stdlib/constants-float64-ninf\n* @type {number}\n*\n* @example\n* import FLOAT64_NINF from '@stdlib/constants-float64-ninf';\n* // returns -Infinity\n*/\n\n// MODULES //\n\nimport Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point negative infinity has the bit sequence\n*\n* ```binarystring\n* 1 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.NEGATIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_NINF = Number.NEGATIVE_INFINITY;\n\n\n// EXPORTS //\n\nexport default FLOAT64_NINF;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport PINF from '@stdlib/constants-float64-pinf';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport isInt from '@stdlib/math-base-assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a number primitive is an integer value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a number primitive is an integer value\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tvalue < PINF &&\n\t\tvalue > NINF &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having an integer value\n*\n* @example\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isNumber } from '@stdlib/assert-is-number';\nimport isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having an integer value\n*\n* @example\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an integer\n*\n* @example\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isInteger( -3.14 );\n* // returns false\n*\n* @example\n* var bool = isInteger( null );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a nonnegative integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a nonnegative integer\n*\n* @example\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( null );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Formats an error message for production.\n*\n* @param {string} code - error code\n* @param {*} ...args - error message arguments\n* @returns {string} formatted error message\n*\n* @example\n* var msg = fmtprodmsg( '3', 'wrong_type' );\n* // returns 'https://stdlib.io/e/3?&arg[]=wrong_type'\n*/\nfunction fmtprodmsg() {\n\tvar a = arguments;\n\tvar c = a[ 0 ];\n\tvar u = 'https://stdlib.io/e/'+c+'?';\n\tvar i;\n\tfor ( i = 1; i < a.length; i++ ) {\n\t\tu += '&arg[]=' + encodeURIComponent( a[ i ] );\n\t}\n\treturn u;\n}\n\n\n// EXPORTS //\n\nexport default fmtprodmsg;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an integer.\n*\n* @module @stdlib/assert-is-integer\n*\n* @example\n* import isInteger from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isInteger( -3.14 );\n* // returns false\n*\n* bool = isInteger( null );\n* // returns false\n*\n* @example\n* // Use interface to check for integer primitives...\n* import { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*\n* @example\n* // Use interface to check for integer objects...\n* import { isObject as isInteger } from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a nonnegative integer.\n*\n* @module @stdlib/assert-is-nonnegative-integer\n*\n* @example\n* import isNonNegativeInteger from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* bool = isNonNegativeInteger( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasArrayBuffer = ( typeof ArrayBuffer === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an ArrayBuffer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an ArrayBuffer\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var bool = isArrayBuffer( new ArrayBuffer( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isArrayBuffer( [] );\n* // returns false\n*/\nfunction isArrayBuffer( value ) {\n\treturn (\n\t\t( hasArrayBuffer && value instanceof ArrayBuffer ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object ArrayBuffer]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array-float64\n*\n* @example\n* import ctor from '@stdlib/array-float64';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFloat64ArraySupport from '@stdlib/assert-has-float64array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat64ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasFloat64Array = ( typeof Float64Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float64Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float64Array\n*\n* @example\n* var bool = isFloat64Array( new Float64Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat64Array( [] );\n* // returns false\n*/\nfunction isFloat64Array( value ) {\n\treturn (\n\t\t( hasFloat64Array && value instanceof Float64Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float64Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isFloat64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Float64Array === 'function' ) ? Float64Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Float64Array === 'function' ) ? Float64Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFloat64Array from '@stdlib/assert-is-float64array';\nimport GlobalFloat64Array from './float64array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Float64Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float64Array` support\n*\n* @example\n* var bool = hasFloat64ArraySupport();\n* // returns \n*/\nfunction hasFloat64ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat64Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat64Array( [ 1.0, 3.14, -3.14, NaN ] );\n\t\tbool = (\n\t\t\tisFloat64Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.14 &&\n\t\t\tarr[ 2 ] === -3.14 &&\n\t\t\tarr[ 3 ] !== arr[ 3 ]\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasFloat64ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of double-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor which returns an object used to represent a generic, fixed-length raw binary data buffer.\n*\n* @module @stdlib/array-buffer\n*\n* @example\n* import ctor from '@stdlib/array-buffer';\n*\n* var buf = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasArrayBufferSupport from '@stdlib/assert-has-arraybuffer-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasArrayBufferSupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof ArrayBuffer === 'function' ) ? ArrayBuffer : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof ArrayBuffer === 'function' ) ? ArrayBuffer : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport Float64Array from '@stdlib/array-float64';\nimport GlobalArrayBuffer from './arraybuffer.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `ArrayBuffer` support.\n*\n* @returns {boolean} boolean indicating if an environment has `ArrayBuffer` support\n*\n* @example\n* var bool = hasArrayBufferSupport();\n* // returns \n*/\nfunction hasArrayBufferSupport() {\n\tvar bool;\n\tvar view;\n\tvar buf;\n\n\tif ( typeof GlobalArrayBuffer !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tbuf = new GlobalArrayBuffer( 16 );\n\t\tbool = ( isArrayBuffer( buf ) && typeof GlobalArrayBuffer.isView === 'function' );\n\t\tif ( bool ) {\n\t\t\tview = new Float64Array( buf );\n\t\t\tview[ 0 ] = -3.14;\n\t\t\tview[ 1 ] = NaN;\n\t\t\tbool = (\n\t\t\t\tbool &&\n\t\t\t\tGlobalArrayBuffer.isView( view ) &&\n\t\t\t\tbuf.byteLength === 16 &&\n\t\t\t\tview[ 0 ] === -3.14 &&\n\t\t\t\tview[ 1 ] !== view[ 1 ]\n\t\t\t);\n\t\t}\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasArrayBufferSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Constructor which returns an object used to represent a generic, fixed-length raw binary data buffer.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is `NaN`.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 7.0 );\n* // returns false\n*/\nfunction isnan( x ) {\n\treturn ( x !== x );\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport PINF from '@stdlib/constants-float64-pinf';\nimport NINF from '@stdlib/constants-float64-ninf';\n\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is infinite.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is infinite\n*\n* @example\n* var bool = isInfinite( Infinity );\n* // returns true\n*\n* @example\n* var bool = isInfinite( -Infinity );\n* // returns true\n*\n* @example\n* var bool = isInfinite( 5.0 );\n* // returns false\n*\n* @example\n* var bool = isInfinite( NaN );\n* // returns false\n*/\nfunction isInfinite( x ) {\n\treturn (x === PINF || x === NINF);\n}\n\n\n// EXPORTS //\n\nexport default isInfinite;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math-base-assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a finite numeric value is an even number.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an even number\n*\n* @example\n* var bool = isEven( 5.0 );\n* // returns false\n*\n* @example\n* var bool = isEven( -2.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( 0.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( NaN );\n* // returns false\n*/\nfunction isEven( x ) {\n\treturn isInteger( x/2.0 );\n}\n\n\n// EXPORTS //\n\nexport default isEven;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isEven from '@stdlib/math-base-assert-is-even';\n\n\n// MAIN //\n\n/**\n* Tests if a finite double-precision floating-point number is an odd number.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an odd number\n*\n* @example\n* var bool = isOdd( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isOdd( -2.0 );\n* // returns false\n*\n* @example\n* var bool = isOdd( 0.0 );\n* // returns false\n*\n* @example\n* var bool = isOdd( NaN );\n* // returns false\n*/\nfunction isOdd( x ) {\n\t// Check sign to prevent overflow...\n\tif ( x > 0.0 ) {\n\t\treturn isEven( x-1.0 );\n\t}\n\treturn isEven( x+1.0 );\n}\n\n\n// EXPORTS //\n\nexport default isOdd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Compute the principal square root of a double-precision floating-point number.\n*\n* @type {Function}\n* @param {number} x - input value\n* @returns {number} principal square root\n*\n* @example\n* var v = sqrt( 4.0 );\n* // returns 2.0\n*\n* v = sqrt( 9.0 );\n* // returns 3.0\n*\n* v = sqrt( 0.0 );\n* // returns 0.0\n*\n* v = sqrt( -4.0 );\n* // returns NaN\n*\n* v = sqrt( NaN );\n* // returns NaN\n*/\nvar sqrt = Math.sqrt; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default sqrt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the absolute value of a double-precision floating-point number `x`.\n*\n* @param {number} x - input value\n* @returns {number} absolute value\n*\n* @example\n* var v = abs( -1.0 );\n* // returns 1.0\n*\n* @example\n* var v = abs( 2.0 );\n* // returns 2.0\n*\n* @example\n* var v = abs( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( -0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( NaN );\n* // returns NaN\n*/\nfunction abs( x ) {\n\treturn Math.abs( x ); // eslint-disable-line stdlib/no-builtin-math\n}\n\n\n// EXPORTS //\n\nexport default abs;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint32Array = ( typeof Uint32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint32Array\n*\n* @example\n* var bool = isUint32Array( new Uint32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint32Array( [] );\n* // returns false\n*/\nfunction isUint32Array( value ) {\n\treturn (\n\t\t( hasUint32Array && value instanceof Uint32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint32\n*\n* @example\n* import ctor from '@stdlib/array-uint32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint32ArraySupport from '@stdlib/assert-has-uint32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint32Array === 'function' ) ? Uint32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint32Array === 'function' ) ? Uint32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint32Array from '@stdlib/assert-is-uint32array';\nimport UINT32_MAX from '@stdlib/constants-uint32-max';\nimport GlobalUint32Array from './uint32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint32Array` support\n*\n* @example\n* var bool = hasUint32ArraySupport();\n* // returns \n*/\nfunction hasUint32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT32_MAX+1, UINT32_MAX+2 ];\n\t\tarr = new GlobalUint32Array( arr );\n\t\tbool = (\n\t\t\tisUint32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT32_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 32-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint8\n*\n* @example\n* import ctor from '@stdlib/array-uint8';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint8ArraySupport from '@stdlib/assert-has-uint8array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint8Array = ( typeof Uint8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8Array\n*\n* @example\n* var bool = isUint8Array( new Uint8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8Array( [] );\n* // returns false\n*/\nfunction isUint8Array( value ) {\n\treturn (\n\t\t( hasUint8Array && value instanceof Uint8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint8Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint8Array === 'function' ) ? Uint8Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint8Array === 'function' ) ? Uint8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint8Array from '@stdlib/assert-is-uint8array';\nimport UINT8_MAX from '@stdlib/constants-uint8-max';\nimport GlobalUint8Array from './uint8array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8Array` support\n*\n* @example\n* var bool = hasUint8ArraySupport();\n* // returns \n*/\nfunction hasUint8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT8_MAX+1, UINT8_MAX+2 ];\n\t\tarr = new GlobalUint8Array( arr );\n\t\tbool = (\n\t\t\tisUint8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT8_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint8ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint16\n*\n* @example\n* import ctor from '@stdlib/array-uint16';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint16ArraySupport from '@stdlib/assert-has-uint16array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint16Array = ( typeof Uint16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint16Array\n*\n* @example\n* var bool = isUint16Array( new Uint16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint16Array( [] );\n* // returns false\n*/\nfunction isUint16Array( value ) {\n\treturn (\n\t\t( hasUint16Array && value instanceof Uint16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint16Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint16Array === 'function' ) ? Uint16Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint16Array === 'function' ) ? Uint16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint16Array from '@stdlib/assert-is-uint16array';\nimport UINT16_MAX from '@stdlib/constants-uint16-max';\nimport GlobalUint16Array from './uint16array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint16Array` support\n*\n* @example\n* var bool = hasUint16ArraySupport();\n* // returns \n*/\nfunction hasUint16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT16_MAX+1, UINT16_MAX+2 ];\n\t\tarr = new GlobalUint16Array( arr );\n\t\tbool = (\n\t\t\tisUint16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT16_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint16ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 16-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctors from './ctors.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an environment is little endian.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment is little endian\n*\n* @example\n* var bool = isLittleEndian();\n* // returns \n*/\nfunction isLittleEndian() {\n\tvar uint16view;\n\tvar uint8view;\n\n\tuint16view = new ctors[ 'uint16' ]( 1 );\n\n\t/*\n\t* Set the uint16 view to a value having distinguishable lower and higher order words.\n\t*\n\t* 4660 => 0x1234 => 0x12 0x34 => '00010010 00110100' => (0x12,0x34) == (18,52)\n\t*/\n\tuint16view[ 0 ] = 0x1234;\n\n\t// Create a uint8 view on top of the uint16 buffer:\n\tuint8view = new ctors[ 'uint8' ]( uint16view.buffer );\n\n\t// If little endian, the least significant byte will be first...\n\treturn ( uint8view[ 0 ] === 0x34 );\n}\n\n\n// MAIN //\n\nbool = isLittleEndian();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint16Array from '@stdlib/array-uint16';\n\n\n// MAIN //\n\nvar ctors = {\n\t'uint16': Uint16Array,\n\t'uint8': Uint8Array\n};\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isLittleEndian from '@stdlib/assert-is-little-endian';\n\n\n// MAIN //\n\nvar indices;\nvar HIGH;\nvar LOW;\n\nif ( isLittleEndian === true ) {\n\tHIGH = 1; // second index\n\tLOW = 0; // first index\n} else {\n\tHIGH = 0; // first index\n\tLOW = 1; // second index\n}\nindices = {\n\t'HIGH': HIGH,\n\t'LOW': LOW\n};\n\n\n// EXPORTS //\n\nexport default indices;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float64Array from '@stdlib/array-float64';\nimport indices from './indices.js';\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\nvar HIGH = indices.HIGH;\nvar LOW = indices.LOW;\n\n\n// MAIN //\n\n/**\n* Splits a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @private\n* @param {number} x - input value\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var out = new Uint32Array( 2 );\n*\n* var w = toWords( 3.14e201, out, 1, 0 );\n* // returns [ 1774486211, 2479577218 ]\n*\n* var bool = ( w === out );\n* // returns true\n*/\nfunction toWords( x, out, stride, offset ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\tout[ offset ] = UINT32_VIEW[ HIGH ];\n\tout[ offset + stride ] = UINT32_VIEW[ LOW ];\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toWords;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport fcn from './assign.js';\n\n\n// MAIN //\n\n/**\n* Splits a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* @param {number} x - input value\n* @returns {Array} output array\n*\n* @example\n* var w = toWords( 3.14e201 );\n* // returns [ 1774486211, 2479577218 ]\n*/\nfunction toWords( x ) {\n\treturn fcn( x, [ 0>>>0, 0>>>0 ], 1, 0 );\n}\n\n\n// EXPORTS //\n\nexport default toWords;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* @module @stdlib/number-float64-base-to-words\n*\n* @example\n* import toWords from '@stdlib/number-float64-base-to-words';\n*\n* var w = toWords( 3.14e201 );\n* // returns [ 1774486211, 2479577218 ]\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n* import toWords from '@stdlib/number-float64-base-to-words';\n*\n* var out = new Uint32Array( 2 );\n*\n* var w = toWords.assign( 3.14e201, out, 1, 0 );\n* // returns [ 1774486211, 2479577218 ]\n*\n* var bool = ( w === out );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isLittleEndian from '@stdlib/assert-is-little-endian';\n\n\n// MAIN //\n\nvar LOW;\nif ( isLittleEndian === true ) {\n\tLOW = 0; // first index\n} else {\n\tLOW = 1; // second index\n}\n\n\n// EXPORTS //\n\nexport default LOW;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float64Array from '@stdlib/array-float64';\nimport LOW from './low.js';\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\n\n// MAIN //\n\n/**\n* Sets the less significant 32 bits of a double-precision floating-point number.\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the lower order bits? If little endian, the first; if big endian, the second.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {number} x - double\n* @param {uinteger32} low - unsigned 32-bit integer to replace the lower order word of `x`\n* @returns {number} double having the same higher order word as `x`\n*\n* @example\n* var low = 5 >>> 0; // => 00000000000000000000000000000101\n*\n* var x = 3.14e201; // => 0 11010011100 01001000001011000011 10010011110010110101100010000010\n*\n* var y = setLowWord( x, low ); // => 0 11010011100 01001000001011000011 00000000000000000000000000000101\n* // returns 3.139998651394392e+201\n*\n* @example\n* import PINF from '@stdlib/constants-float64-pinf';\n* import NINF from '@stdlib/constants-float64-ninf';\n*\n* var low = 12345678;\n*\n* var y = setLowWord( PINF, low );\n* // returns NaN\n*\n* y = setLowWord( NINF, low );\n* // returns NaN\n*\n* y = setLowWord( NaN, low );\n* // returns NaN\n*/\nfunction setLowWord( x, low ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\tUINT32_VIEW[ LOW ] = ( low >>> 0 ); // identity bit shift to ensure integer\n\treturn FLOAT64_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nexport default setLowWord;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Converts an unsigned 32-bit integer to a signed 32-bit integer.\n*\n* @param {uinteger32} x - unsigned 32-bit integer\n* @returns {integer32} signed 32-bit integer\n*\n* @example\n* import float64ToUint32 from '@stdlib/number-float64-base-to-uint32';\n* var y = uint32ToInt32( float64ToUint32( 4294967295 ) );\n* // returns -1\n*\n* @example\n* import float64ToUint32 from '@stdlib/number-float64-base-to-uint32';\n* var y = uint32ToInt32( float64ToUint32( 3 ) );\n* // returns 3\n*/\nfunction uint32ToInt32( x ) {\n\t// NOTE: we could also use typed-arrays to achieve the same end.\n\treturn x|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nexport default uint32ToInt32;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* High word mask for excluding the sign bit of a double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-high-word-abs-mask\n* @type {uinteger32}\n*\n* @example\n* import FLOAT64_HIGH_WORD_ABS_MASK from '@stdlib/constants-float64-high-word-abs-mask';\n* // returns 2147483647\n*/\n\n\n// MAIN //\n\n/**\n* High word mask for excluding the sign bit of a double-precision floating-point number.\n*\n* ## Notes\n*\n* The high word mask for excluding the sign bit of a double-precision floating-point number is an unsigned 32-bit integer with the value \\\\( 2147483647 \\\\), which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 11111111111 11111111111111111111\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 0x7fffffff\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_HIGH_WORD_ABS_MASK = 0x7fffffff>>>0; // eslint-disable-line id-length\n\n\n// EXPORTS //\n\nexport default FLOAT64_HIGH_WORD_ABS_MASK;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isLittleEndian from '@stdlib/assert-is-little-endian';\n\n\n// MAIN //\n\nvar indices;\nvar HIGH;\nvar LOW;\n\nif ( isLittleEndian === true ) {\n\tHIGH = 1; // second index\n\tLOW = 0; // first index\n} else {\n\tHIGH = 0; // first index\n\tLOW = 1; // second index\n}\nindices = {\n\t'HIGH': HIGH,\n\t'LOW': LOW\n};\n\n\n// EXPORTS //\n\nexport default indices;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* High word mask for the sign bit of a double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-high-word-sign-mask\n* @type {uinteger32}\n*\n* @example\n* import FLOAT64_HIGH_WORD_SIGN_MASK from '@stdlib/constants-float64-high-word-sign-mask';\n* // returns 2147483648\n*/\n\n\n// MAIN //\n\n/**\n* High word mask for the sign bit of a double-precision floating-point number.\n*\n* ## Notes\n*\n* The high word mask for the sign bit of a double-precision floating-point number is an unsigned 32-bit integer with the value \\\\( 2147483648 \\\\), which corresponds to the bit sequence\n*\n* ```binarystring\n* 1 00000000000 00000000000000000000\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 0x80000000\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_HIGH_WORD_SIGN_MASK = 0x80000000>>>0; // eslint-disable-line id-length\n\n\n// EXPORTS //\n\nexport default FLOAT64_HIGH_WORD_SIGN_MASK;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isLittleEndian from '@stdlib/assert-is-little-endian';\n\n\n// MAIN //\n\nvar HIGH;\nif ( isLittleEndian === true ) {\n\tHIGH = 1; // second index\n} else {\n\tHIGH = 0; // first index\n}\n\n\n// EXPORTS //\n\nexport default HIGH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float64Array from '@stdlib/array-float64';\nimport HIGH from './high.js';\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\n\n// MAIN //\n\n/**\n* Returns an unsigned 32-bit integer corresponding to the more significant 32 bits of a double-precision floating-point number.\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {number} x - input value\n* @returns {uinteger32} higher order word\n*\n* @example\n* var w = getHighWord( 3.14e201 ); // => 01101001110001001000001011000011\n* // returns 1774486211\n*/\nfunction getHighWord( x ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\treturn UINT32_VIEW[ HIGH ];\n}\n\n\n// EXPORTS //\n\nexport default getHighWord;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float64Array from '@stdlib/array-float64';\nimport indices from './indices.js';\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\nvar HIGH = indices.HIGH;\nvar LOW = indices.LOW;\n\n\n// MAIN //\n\n/**\n* Creates a double-precision floating-point number from a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 should we place the higher order bits? If little endian, the second; if big endian, the first.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {uinteger32} high - higher order word (unsigned 32-bit integer)\n* @param {uinteger32} low - lower order word (unsigned 32-bit integer)\n* @returns {number} floating-point number\n*\n* @example\n* var v = fromWords( 1774486211, 2479577218 );\n* // returns 3.14e201\n*\n* @example\n* var v = fromWords( 3221823995, 1413754136 );\n* // returns -3.141592653589793\n*\n* @example\n* var v = fromWords( 0, 0 );\n* // returns 0.0\n*\n* @example\n* var v = fromWords( 2147483648, 0 );\n* // returns -0.0\n*\n* @example\n* var v = fromWords( 2146959360, 0 );\n* // returns NaN\n*\n* @example\n* var v = fromWords( 2146435072, 0 );\n* // returns Infinity\n*\n* @example\n* var v = fromWords( 4293918720, 0 );\n* // returns -Infinity\n*/\nfunction fromWords( high, low ) {\n\tUINT32_VIEW[ HIGH ] = high;\n\tUINT32_VIEW[ LOW ] = low;\n\treturn FLOAT64_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nexport default fromWords;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport SIGN_MASK from '@stdlib/constants-float64-high-word-sign-mask';\nimport ABS_MASK from '@stdlib/constants-float64-high-word-abs-mask';\nimport toWords from '@stdlib/number-float64-base-to-words';\nimport getHighWord from '@stdlib/number-float64-base-get-high-word';\nimport fromWords from '@stdlib/number-float64-base-from-words';\n\n\n// VARIABLES //\n\n// High/low words workspace:\nvar WORDS = [ 0, 0 ];\n\n\n// MAIN //\n\n/**\n* Returns a double-precision floating-point number with the magnitude of `x` and the sign of `y`.\n*\n* @param {number} x - number from which to derive a magnitude\n* @param {number} y - number from which to derive a sign\n* @returns {number} a double-precision floating-point number\n*\n* @example\n* var z = copysign( -3.14, 10.0 );\n* // returns 3.14\n*\n* @example\n* var z = copysign( 3.14, -1.0 );\n* // returns -3.14\n*\n* @example\n* var z = copysign( 1.0, -0.0 );\n* // returns -1.0\n*\n* @example\n* var z = copysign( -3.14, -0.0 );\n* // returns -3.14\n*\n* @example\n* var z = copysign( -0.0, 1.0 );\n* // returns 0.0\n*/\nfunction copysign( x, y ) {\n\tvar hx;\n\tvar hy;\n\n\t// Split `x` into higher and lower order words:\n\ttoWords.assign( x, WORDS, 1, 0 );\n\thx = WORDS[ 0 ];\n\n\t// Turn off the sign bit of `x`:\n\thx &= ABS_MASK;\n\n\t// Extract the higher order word from `y`:\n\thy = getHighWord( y );\n\n\t// Leave only the sign bit of `y` turned on:\n\thy &= SIGN_MASK;\n\n\t// Copy the sign bit of `y` to `x`:\n\thx |= hy;\n\n\t// Return a new value having the same magnitude as `x`, but with the sign of `y`:\n\treturn fromWords( hx, WORDS[ 1 ] );\n}\n\n\n// EXPORTS //\n\nexport default copysign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ABS_MASK from '@stdlib/constants-float64-high-word-abs-mask';\nimport getHighWord from '@stdlib/number-float64-base-get-high-word';\n\n\n// VARIABLES //\n\n// 0x3fefffff = 1072693247 => 0 01111111110 11111111111111111111 => biased exponent: 1022 = -1+1023 => 2^-1\nvar HIGH_MAX_NEAR_UNITY = 0x3fefffff|0; // asm type annotation\n\nvar HUGE = 1.0e300;\nvar TINY = 1.0e-300;\n\n\n// MAIN //\n\n/**\n* Evaluates the exponential function when \\\\(|y| > 2^64\\\\).\n*\n* @private\n* @param {number} x - base\n* @param {number} y - exponent\n* @returns {number} overflow or underflow result\n*\n* @example\n* var v = pow( 9.0, 3.6893488147419103e19 );\n* // returns Infinity\n*\n* @example\n* var v = pow( -3.14, -3.6893488147419103e19 );\n* // returns 0.0\n*/\nfunction pow( x, y ) {\n\tvar ahx;\n\tvar hx;\n\n\thx = getHighWord( x );\n\tahx = (hx & ABS_MASK);\n\n\tif ( ahx <= HIGH_MAX_NEAR_UNITY ) {\n\t\tif ( y < 0 ) {\n\t\t\t// Signal overflow...\n\t\t\treturn HUGE * HUGE;\n\t\t}\n\t\t// Signal underflow...\n\t\treturn TINY * TINY;\n\t}\n\t// `x` has a biased exponent greater than or equal to `0`...\n\n\tif ( y > 0 ) {\n\t\t// Signal overflow...\n\t\treturn HUGE * HUGE;\n\t}\n\t// Signal underflow...\n\treturn TINY * TINY;\n}\n\n\n// EXPORTS //\n\nexport default pow;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isLittleEndian from '@stdlib/assert-is-little-endian';\n\n\n// MAIN //\n\nvar HIGH;\nif ( isLittleEndian === true ) {\n\tHIGH = 1; // second index\n} else {\n\tHIGH = 0; // first index\n}\n\n\n// EXPORTS //\n\nexport default HIGH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float64Array from '@stdlib/array-float64';\nimport HIGH from './high.js';\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\n\n// MAIN //\n\n/**\n* Sets the more significant 32 bits of a double-precision floating-point number.\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {number} x - double\n* @param {uinteger32} high - unsigned 32-bit integer to replace the higher order word of `x`\n* @returns {number} double having the same lower order word as `x`\n*\n* @example\n* var high = 5 >>> 0; // => 0 00000000000 00000000000000000101\n*\n* var y = setHighWord( 3.14e201, high ); // => 0 00000000000 0000000000000000010110010011110010110101100010000010\n* // returns 1.18350528745e-313\n*\n* @example\n* import PINF from '@stdlib/constants-float64-pinf'; // => 0 11111111111 00000000000000000000 00000000000000000000000000000000\n*\n* var high = 1072693248 >>> 0; // => 0 01111111111 00000000000000000000\n*\n* // Set the higher order bits of `+infinity` to return `1`:\n* var y = setHighWord( PINF, high ); // => 0 01111111111 0000000000000000000000000000000000000000000000000000\n* // returns 1.0\n*/\nfunction setHighWord( x, high ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\tUINT32_VIEW[ HIGH ] = ( high >>> 0 ); // identity bit shift to ensure integer\n\treturn FLOAT64_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nexport default setHighWord;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The bias of a double-precision floating-point number's exponent.\n*\n* @module @stdlib/constants-float64-exponent-bias\n* @type {integer32}\n*\n* @example\n* import FLOAT64_EXPONENT_BIAS from '@stdlib/constants-float64-exponent-bias';\n* // returns 1023\n*/\n\n\n// MAIN //\n\n/**\n* Bias of a double-precision floating-point number's exponent.\n*\n* ## Notes\n*\n* The bias can be computed via\n*\n* ```tex\n* \\mathrm{bias} = 2^{k-1} - 1\n* ```\n*\n* where \\\\(k\\\\) is the number of bits in the exponent; here, \\\\(k = 11\\\\).\n*\n* @constant\n* @type {integer32}\n* @default 1023\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_EXPONENT_BIAS = 1023|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default FLOAT64_EXPONENT_BIAS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getHighWord from '@stdlib/number-float64-base-get-high-word';\nimport setLowWord from '@stdlib/number-float64-base-set-low-word';\nimport setHighWord from '@stdlib/number-float64-base-set-high-word';\nimport BIAS from '@stdlib/constants-float64-exponent-bias';\nimport polyvalL from './polyval_l.js';\n\n\n// VARIABLES //\n\n// 0x000fffff = 1048575 => 0 00000000000 11111111111111111111\nvar HIGH_SIGNIFICAND_MASK = 0x000fffff|0; // asm type annotation\n\n// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022\nvar HIGH_MIN_NORMAL_EXP = 0x00100000|0; // asm type annotation\n\n// 0x3ff00000 = 1072693248 => 0 01111111111 00000000000000000000 => biased exponent: 1023 = 0+1023 => 2^0 = 1\nvar HIGH_BIASED_EXP_0 = 0x3ff00000|0; // asm type annotation\n\n// 0x20000000 = 536870912 => 0 01000000000 00000000000000000000 => biased exponent: 512 = -511+1023\nvar HIGH_BIASED_EXP_NEG_512 = 0x20000000|0; // asm type annotation\n\n// 0x00080000 = 524288 => 0 00000000000 10000000000000000000\nvar HIGH_SIGNIFICAND_HALF = 0x00080000|0; // asm type annotation\n\n// TODO: consider making an external constant\nvar HIGH_NUM_SIGNIFICAND_BITS = 20|0; // asm type annotation\n\nvar TWO53 = 9007199254740992.0;\t// 0x43400000, 0x00000000\n\n// 2/(3*LN2)\nvar CP = 9.61796693925975554329e-01; // 0x3FEEC709, 0xDC3A03FD\n\n// (float)CP\nvar CP_HI = 9.61796700954437255859e-01; // 0x3FEEC709, 0xE0000000\n\n// Low: CP_HI\nvar CP_LO = -7.02846165095275826516e-09; // 0xBE3E2FE0, 0x145B01F5\n\nvar BP = [\n\t1.0,\n\t1.5\n];\nvar DP_HI = [\n\t0.0,\n\t5.84962487220764160156e-01 // 0x3FE2B803, 0x40000000\n];\nvar DP_LO = [\n\t0.0,\n\t1.35003920212974897128e-08 // 0x3E4CFDEB, 0x43CFD006\n];\n\n\n// MAIN //\n\n/**\n* Computes \\\\(\\operatorname{log2}(ax)\\\\).\n*\n* @private\n* @param {Array} out - output array\n* @param {number} ax - absolute value of `x`\n* @param {number} ahx - high word of `ax`\n* @returns {Array} output array containing a tuple comprised of high and low parts\n*\n* @example\n* var t = log2ax( [ 0.0, 0.0 ], 9.0, 1075970048 ); // => [ t1, t2 ]\n* // returns [ 3.169923782348633, 0.0000012190936795504075 ]\n*/\nfunction log2ax( out, ax, ahx ) {\n\tvar tmp;\n\tvar ss; // `hs + ls`\n\tvar s2; // `ss` squared\n\tvar hs;\n\tvar ls;\n\tvar ht;\n\tvar lt;\n\tvar bp; // `BP` constant\n\tvar dp; // `DP` constant\n\tvar hp;\n\tvar lp;\n\tvar hz;\n\tvar lz;\n\tvar t1;\n\tvar t2;\n\tvar t;\n\tvar r;\n\tvar u;\n\tvar v;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tn = 0|0; // asm type annotation\n\n\t// Check if `x` is subnormal...\n\tif ( ahx < HIGH_MIN_NORMAL_EXP ) {\n\t\tax *= TWO53;\n\t\tn -= 53|0; // asm type annotation\n\t\tahx = getHighWord( ax );\n\t}\n\t// Extract the unbiased exponent of `x`:\n\tn += ((ahx >> HIGH_NUM_SIGNIFICAND_BITS) - BIAS)|0; // asm type annotation\n\n\t// Isolate the significand bits of `x`:\n\tj = (ahx & HIGH_SIGNIFICAND_MASK)|0; // asm type annotation\n\n\t// Normalize `ahx` by setting the (biased) exponent to `1023`:\n\tahx = (j | HIGH_BIASED_EXP_0)|0; // asm type annotation\n\n\t// Determine the interval of `|x|` by comparing significand bits...\n\n\t// |x| < sqrt(3/2)\n\tif ( j <= 0x3988E ) { // 0 00000000000 00111001100010001110\n\t\tk = 0;\n\t}\n\t// |x| < sqrt(3)\n\telse if ( j < 0xBB67A ) { // 0 00000000000 10111011011001111010\n\t\tk = 1;\n\t}\n\t// |x| >= sqrt(3)\n\telse {\n\t\tk = 0;\n\t\tn += 1|0; // asm type annotation\n\t\tahx -= HIGH_MIN_NORMAL_EXP;\n\t}\n\t// Load the normalized high word into `|x|`:\n\tax = setHighWord( ax, ahx );\n\n\t// Compute `ss = hs + ls = (x-1)/(x+1)` or `(x-1.5)/(x+1.5)`:\n\tbp = BP[ k ]; // BP[0] = 1.0, BP[1] = 1.5\n\tu = ax - bp; // (x-1) || (x-1.5)\n\tv = 1.0 / (ax + bp); // 1/(x+1) || 1/(x+1.5)\n\tss = u * v;\n\ths = setLowWord( ss, 0 ); // set all low word (less significant significand) bits to 0s\n\n\t// Compute `ht = ax + bp` (via manipulation, i.e., bit flipping, of the high word):\n\ttmp = ((ahx>>1) | HIGH_BIASED_EXP_NEG_512) + HIGH_SIGNIFICAND_HALF;\n\ttmp += (k << 18); // `(k<<18)` can be considered the word equivalent of `1.0` or `1.5`\n\tht = setHighWord( 0.0, tmp );\n\tlt = ax - (ht - bp);\n\tls = v * ( ( u - (hs*ht) ) - ( hs*lt ) );\n\n\t// Compute `log(ax)`...\n\n\ts2 = ss * ss;\n\tr = s2 * s2 * polyvalL( s2 );\n\tr += ls * (hs + ss);\n\ts2 = hs * hs;\n\tht = 3.0 + s2 + r;\n\tht = setLowWord( ht, 0 );\n\tlt = r - ((ht-3.0) - s2);\n\n\t// u+v = ss*(1+...):\n\tu = hs * ht;\n\tv = ( ls*ht ) + ( lt*ss );\n\n\t// 2/(3LN2) * (ss+...):\n\thp = u + v;\n\thp = setLowWord( hp, 0 );\n\tlp = v - (hp - u);\n\thz = CP_HI * hp; // CP_HI+CP_LO = 2/(3*LN2)\n\tlz = ( CP_LO*hp ) + ( lp*CP ) + DP_LO[ k ];\n\n\t// log2(ax) = (ss+...)*2/(3*LN2) = n + dp + hz + lz\n\tdp = DP_HI[ k ];\n\tt = n;\n\tt1 = ((hz+lz) + dp) + t; // log2(ax)\n\tt1 = setLowWord( t1, 0 );\n\tt2 = lz - (((t1-t) - dp) - hz);\n\n\tout[ 0 ] = t1;\n\tout[ 1 ] = t2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default log2ax;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport setLowWord from '@stdlib/number-float64-base-set-low-word';\nimport polyvalW from './polyval_w.js';\n\n\n// VARIABLES //\n\n// 1/LN2\nvar INV_LN2 = 1.44269504088896338700e+00; // 0x3FF71547, 0x652B82FE\n\n// High (24 bits): 1/LN2\nvar INV_LN2_HI = 1.44269502162933349609e+00; // 0x3FF71547, 0x60000000\n\n// Low: 1/LN2\nvar INV_LN2_LO = 1.92596299112661746887e-08; // 0x3E54AE0B, 0xF85DDF44\n\n\n// MAIN //\n\n/**\n* Computes \\\\(\\operatorname{log}(x)\\\\) assuming \\\\(|1-x|\\\\) is small and using the approximation \\\\(x - x^2/2 + x^3/3 - x^4/4\\\\).\n*\n* @private\n* @param {Array} out - output array\n* @param {number} ax - absolute value of `x`\n* @returns {Array} output array containing a tuple comprised of high and low parts\n*\n* @example\n* var t = logx( [ 0.0, 0.0 ], 9.0 ); // => [ t1, t2 ]\n* // returns [ -1265.7236328125, -0.0008163940840404393 ]\n*/\nfunction logx( out, ax ) {\n\tvar t2;\n\tvar t1;\n\tvar t;\n\tvar w;\n\tvar u;\n\tvar v;\n\n\tt = ax - 1.0; // `t` has `20` trailing zeros\n\tw = t * t * polyvalW( t );\n\tu = INV_LN2_HI * t; // `INV_LN2_HI` has `21` significant bits\n\tv = ( t*INV_LN2_LO ) - ( w*INV_LN2 );\n\tt1 = u + v;\n\tt1 = setLowWord( t1, 0 );\n\tt2 = v - (t1 - u);\n\n\tout[ 0 ] = t1;\n\tout[ 1 ] = t2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default logx;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The maximum biased base 2 exponent for a double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-max-base2-exponent\n* @type {integer32}\n*\n* @example\n* import FLOAT64_MAX_BASE2_EXPONENT from '@stdlib/constants-float64-max-base2-exponent';\n* // returns 1023\n*/\n\n\n// MAIN //\n\n/**\n* The maximum biased base 2 exponent for a double-precision floating-point number.\n*\n* ```text\n* 11111111110 => 2046 - BIAS = 1023\n* ```\n*\n* where `BIAS = 1023`.\n*\n* @constant\n* @type {integer32}\n* @default 1023\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_MAX_BASE2_EXPONENT = 1023|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default FLOAT64_MAX_BASE2_EXPONENT;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The maximum biased base 2 exponent for a subnormal double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-max-base2-exponent-subnormal\n* @type {integer32}\n*\n* @example\n* import FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL from '@stdlib/constants-float64-max-base2-exponent-subnormal';\n* // returns -1023\n*/\n\n\n// MAIN //\n\n/**\n* The maximum biased base 2 exponent for a subnormal double-precision floating-point number.\n*\n* ```text\n* 00000000000 => 0 - BIAS = -1023\n* ```\n*\n* where `BIAS = 1023`.\n*\n* @constant\n* @type {integer32}\n* @default -1023\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL = -1023|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The minimum biased base 2 exponent for a subnormal double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-min-base2-exponent-subnormal\n* @type {integer32}\n*\n* @example\n* import FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL from '@stdlib/constants-float64-min-base2-exponent-subnormal';\n* // returns -1074\n*/\n\n\n// MAIN //\n\n/**\n* The minimum biased base 2 exponent for a subnormal double-precision floating-point number.\n*\n* ```text\n* -(BIAS+(52-1)) = -(1023+51) = -1074\n* ```\n*\n* where `BIAS = 1023` and `52` is the number of digits in the significand.\n*\n* @constant\n* @type {integer32}\n* @default -1074\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL = -1074|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Smallest positive double-precision floating-point normal number.\n*\n* @module @stdlib/constants-float64-smallest-normal\n* @type {number}\n*\n* @example\n* import FLOAT64_SMALLEST_NORMAL from '@stdlib/constants-float64-smallest-normal';\n* // returns 2.2250738585072014e-308\n*/\n\n\n// MAIN //\n\n/**\n* The smallest positive double-precision floating-point normal number.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* \\frac{1}{2^{1023-1}}\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 00000000001 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default 2.2250738585072014e-308\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_SMALLEST_NORMAL = 2.2250738585072014e-308;\n\n\n// EXPORTS //\n\nexport default FLOAT64_SMALLEST_NORMAL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport FLOAT64_SMALLEST_NORMAL from '@stdlib/constants-float64-smallest-normal';\nimport isInfinite from '@stdlib/math-base-assert-is-infinite';\nimport isnan from '@stdlib/math-base-assert-is-nan';\nimport abs from '@stdlib/math-base-special-abs';\n\n\n// VARIABLES //\n\n// (1<<52)\nvar SCALAR = 4503599627370496;\n\n\n// MAIN //\n\n/**\n* Returns a normal number `y` and exponent `exp` satisfying \\\\(x = y \\cdot 2^\\mathrm{exp}\\\\) and assigns results to a provided output array.\n*\n* @param {number} x - input value\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* import pow from '@stdlib/math-base-special-pow';\n*\n* var out = normalize( 3.14e-319, [ 0.0, 0 ], 1, 0 );\n* // returns [ 1.4141234400356668e-303, -52 ]\n*\n* var y = out[ 0 ];\n* var exp = out[ 1 ];\n*\n* var bool = ( y*pow(2.0,exp) === 3.14e-319 );\n* // returns true\n*\n* @example\n* var out = normalize( 0.0, [ 0.0, 0 ], 1, 0 );\n* // returns [ 0.0, 0 ];\n*\n* @example\n* import PINF from '@stdlib/constants-float64-pinf';\n*\n* var out = normalize( PINF, [ 0.0, 0 ], 1, 0 );\n* // returns [ Infinity, 0 ]\n*\n* @example\n* import NINF from '@stdlib/constants-float64-ninf';\n*\n* var out = normalize( NINF, [ 0.0, 0 ], 1, 0 );\n* // returns [ -Infinity, 0 ]\n*\n* @example\n* var out = normalize( NaN, [ 0.0, 0 ], 1, 0 );\n* // returns [ NaN, 0 ]\n*/\nfunction normalize( x, out, stride, offset ) {\n\tif ( isnan( x ) || isInfinite( x ) ) {\n\t\tout[ offset ] = x;\n\t\tout[ offset + stride ] = 0;\n\t\treturn out;\n\t}\n\tif ( x !== 0.0 && abs( x ) < FLOAT64_SMALLEST_NORMAL ) {\n\t\tout[ offset ] = x * SCALAR;\n\t\tout[ offset + stride ] = -52;\n\t\treturn out;\n\t}\n\tout[ offset ] = x;\n\tout[ offset + stride ] = 0;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default normalize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a normal number `y` and exponent `exp` satisfying \\\\(x = y \\cdot 2^\\mathrm{exp}\\\\).\n*\n* @module @stdlib/number-float64-base-normalize\n*\n* @example\n* import normalize from '@stdlib/number-float64-base-normalize';\n* import pow from '@stdlib/math-base-special-pow';\n*\n* var out = normalize( 3.14e-319 );\n* // returns [ 1.4141234400356668e-303, -52 ]\n*\n* var y = out[ 0 ];\n* var exp = out[ 1 ];\n*\n* var bool = ( y*pow(2.0, exp) === 3.14e-319 );\n* // returns true\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n* import normalize from '@stdlib/number-float64-base-normalize';\n*\n* var out = new Float64Array( 2 );\n*\n* var v = normalize.assign( 3.14e-319, out, 1, 0 );\n* // returns [ 1.4141234400356668e-303, -52 ]\n*\n* var bool = ( v === out );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport fcn from './assign.js';\n\n\n// MAIN //\n\n/**\n* Returns a normal number `y` and exponent `exp` satisfying \\\\(x = y \\cdot 2^\\mathrm{exp}\\\\).\n*\n* @param {number} x - input value\n* @returns {NumberArray} output array\n*\n* @example\n* import pow from '@stdlib/math-base-special-pow';\n*\n* var out = normalize( 3.14e-319 );\n* // returns [ 1.4141234400356668e-303, -52 ]\n*\n* var y = out[ 0 ];\n* var exp = out[ 1 ];\n*\n* var bool = ( y*pow(2.0,exp) === 3.14e-319 );\n* // returns true\n*\n* @example\n* var out = normalize( 0.0 );\n* // returns [ 0.0, 0 ]\n*\n* @example\n* import PINF from '@stdlib/constants-float64-pinf';\n*\n* var out = normalize( PINF );\n* // returns [ Infinity, 0 ]\n*\n* @example\n* import NINF from '@stdlib/constants-float64-ninf';\n*\n* var out = normalize( NINF );\n* // returns [ -Infinity, 0 ]\n*\n* @example\n* var out = normalize( NaN );\n* // returns [ NaN, 0 ]\n*/\nfunction normalize( x ) {\n\treturn fcn( x, [ 0.0, 0 ], 1, 0 );\n}\n\n\n// EXPORTS //\n\nexport default normalize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* High word mask for the exponent of a double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-high-word-exponent-mask\n* @type {uinteger32}\n*\n* @example\n* import FLOAT64_HIGH_WORD_EXPONENT_MASK from '@stdlib/constants-float64-high-word-exponent-mask';\n* // returns 2146435072\n*/\n\n\n// MAIN //\n\n/**\n* High word mask for the exponent of a double-precision floating-point number.\n*\n* ## Notes\n*\n* The high word mask for the exponent of a double-precision floating-point number is an unsigned 32-bit integer with the value \\\\( 2146435072 \\\\), which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 11111111111 00000000000000000000\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 0x7ff00000\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_HIGH_WORD_EXPONENT_MASK = 0x7ff00000;\n\n\n// EXPORTS //\n\nexport default FLOAT64_HIGH_WORD_EXPONENT_MASK;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// NOTES //\n\n/*\n* => ldexp: load exponent (see [The Open Group]{@link http://pubs.opengroup.org/onlinepubs/9699919799/functions/ldexp.html} and [cppreference]{@link http://en.cppreference.com/w/c/numeric/math/ldexp}).\n*/\n\n\n// MODULES //\n\nimport PINF from '@stdlib/constants-float64-pinf';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport BIAS from '@stdlib/constants-float64-exponent-bias';\nimport MAX_EXPONENT from '@stdlib/constants-float64-max-base2-exponent';\nimport MAX_SUBNORMAL_EXPONENT from '@stdlib/constants-float64-max-base2-exponent-subnormal';\nimport MIN_SUBNORMAL_EXPONENT from '@stdlib/constants-float64-min-base2-exponent-subnormal';\nimport isnan from '@stdlib/math-base-assert-is-nan';\nimport isInfinite from '@stdlib/math-base-assert-is-infinite';\nimport copysign from '@stdlib/math-base-special-copysign';\nimport { assign as normalize } from '@stdlib/number-float64-base-normalize';\nimport floatExp from '@stdlib/number-float64-base-exponent';\nimport toWords from '@stdlib/number-float64-base-to-words';\nimport fromWords from '@stdlib/number-float64-base-from-words';\n\n\n// VARIABLES //\n\n// 1/(1<<52) = 1/(2**52) = 1/4503599627370496\nvar TWO52_INV = 2.220446049250313e-16;\n\n// Exponent all 0s: 1 00000000000 11111111111111111111 => 2148532223\nvar CLEAR_EXP_MASK = 0x800fffff>>>0; // asm type annotation\n\n// Normalization workspace:\nvar FRAC = [ 0.0, 0.0 ];\n\n// High/low words workspace:\nvar WORDS = [ 0, 0 ];\n\n\n// MAIN //\n\n/**\n* Multiplies a double-precision floating-point number by an integer power of two.\n*\n* @param {number} frac - fraction\n* @param {integer} exp - exponent\n* @returns {number} double-precision floating-point number\n*\n* @example\n* var x = ldexp( 0.5, 3 ); // => 0.5 * 2^3 = 0.5 * 8\n* // returns 4.0\n*\n* @example\n* var x = ldexp( 4.0, -2 ); // => 4 * 2^(-2) = 4 * (1/4)\n* // returns 1.0\n*\n* @example\n* var x = ldexp( 0.0, 20 );\n* // returns 0.0\n*\n* @example\n* var x = ldexp( -0.0, 39 );\n* // returns -0.0\n*\n* @example\n* var x = ldexp( NaN, -101 );\n* // returns NaN\n*\n* @example\n* var x = ldexp( Infinity, 11 );\n* // returns Infinity\n*\n* @example\n* var x = ldexp( -Infinity, -118 );\n* // returns -Infinity\n*/\nfunction ldexp( frac, exp ) {\n\tvar high;\n\tvar m;\n\tif (\n\t\texp === 0 ||\n\t\tfrac === 0.0 || // handles +-0\n\t\tisnan( frac ) ||\n\t\tisInfinite( frac )\n\t) {\n\t\treturn frac;\n\t}\n\t// Normalize the input fraction:\n\tnormalize( frac, FRAC, 1, 0 );\n\tfrac = FRAC[ 0 ];\n\texp += FRAC[ 1 ];\n\n\t// Extract the exponent from `frac` and add it to `exp`:\n\texp += floatExp( frac );\n\n\t// Check for underflow/overflow...\n\tif ( exp < MIN_SUBNORMAL_EXPONENT ) {\n\t\treturn copysign( 0.0, frac );\n\t}\n\tif ( exp > MAX_EXPONENT ) {\n\t\tif ( frac < 0.0 ) {\n\t\t\treturn NINF;\n\t\t}\n\t\treturn PINF;\n\t}\n\t// Check for a subnormal and scale accordingly to retain precision...\n\tif ( exp <= MAX_SUBNORMAL_EXPONENT ) {\n\t\texp += 52;\n\t\tm = TWO52_INV;\n\t} else {\n\t\tm = 1.0;\n\t}\n\t// Split the fraction into higher and lower order words:\n\ttoWords.assign( frac, WORDS, 1, 0 );\n\thigh = WORDS[ 0 ];\n\n\t// Clear the exponent bits within the higher order word:\n\thigh &= CLEAR_EXP_MASK;\n\n\t// Set the exponent bits to the new exponent:\n\thigh |= ((exp+BIAS) << 20);\n\n\t// Create a new floating-point number:\n\treturn m * fromWords( high, WORDS[ 1 ] );\n}\n\n\n// EXPORTS //\n\nexport default ldexp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getHighWord from '@stdlib/number-float64-base-get-high-word';\nimport EXP_MASK from '@stdlib/constants-float64-high-word-exponent-mask';\nimport BIAS from '@stdlib/constants-float64-exponent-bias';\n\n\n// MAIN //\n\n/**\n* Returns an integer corresponding to the unbiased exponent of a double-precision floating-point number.\n*\n* @param {number} x - input value\n* @returns {integer32} unbiased exponent\n*\n* @example\n* var exp = exponent( 3.14e-307 ); // => 2**-1019 ~ 1e-307\n* // returns -1019\n*\n* @example\n* var exp = exponent( -3.14 );\n* // returns 1\n*\n* @example\n* var exp = exponent( 0.0 );\n* // returns -1023\n*\n* @example\n* var exp = exponent( NaN );\n* // returns 1024\n*/\nfunction exponent( x ) {\n\t// Extract from the input value a higher order word (unsigned 32-bit integer) which contains the exponent:\n\tvar high = getHighWord( x );\n\n\t// Apply a mask to isolate only the exponent bits and then shift off all bits which are part of the fraction:\n\thigh = ( high & EXP_MASK ) >>> 20;\n\n\t// Remove the bias and return:\n\treturn (high - BIAS)|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nexport default exponent;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Natural logarithm of `2`.\n*\n* @module @stdlib/constants-float64-ln-two\n* @type {number}\n*\n* @example\n* import LN2 from '@stdlib/constants-float64-ln-two';\n* // returns 0.6931471805599453\n*/\n\n\n// MAIN //\n\n/**\n* Natural logarithm of `2`.\n*\n* ```tex\n* \\ln 2\n* ```\n*\n* @constant\n* @type {number}\n* @default 0.6931471805599453\n*/\nvar LN2 = 6.93147180559945309417232121458176568075500134360255254120680009493393621969694715605863326996418687542001481021e-01; // eslint-disable-line max-len\n\n\n// EXPORTS //\n\nexport default LN2;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* High word mask for the significand of a double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-high-word-significand-mask\n* @type {uinteger32}\n*\n* @example\n* import FLOAT64_HIGH_WORD_SIGNIFICAND_MASK from '@stdlib/constants-float64-high-word-significand-mask';\n* // returns 1048575\n*/\n\n\n// MAIN //\n\n/**\n* High word mask for the significand of a double-precision floating-point number.\n*\n* ## Notes\n*\n* The high word mask for the significand of a double-precision floating-point number is an unsigned 32-bit integer with the value \\\\( 1048575 \\\\), which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 00000000000 11111111111111111111\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 0x000fffff\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = 0x000fffff;\n\n\n// EXPORTS //\n\nexport default FLOAT64_HIGH_WORD_SIGNIFICAND_MASK;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getHighWord from '@stdlib/number-float64-base-get-high-word';\nimport setHighWord from '@stdlib/number-float64-base-set-high-word';\nimport setLowWord from '@stdlib/number-float64-base-set-low-word';\nimport uint32ToInt32 from '@stdlib/number-uint32-base-to-int32';\nimport ldexp from '@stdlib/math-base-special-ldexp';\nimport LN2 from '@stdlib/constants-float64-ln-two';\nimport BIAS from '@stdlib/constants-float64-exponent-bias';\nimport ABS_MASK from '@stdlib/constants-float64-high-word-abs-mask';\nimport HIGH_SIGNIFICAND_MASK from '@stdlib/constants-float64-high-word-significand-mask';\nimport polyvalP from './polyval_p.js';\n\n\n// VARIABLES //\n\n// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022\nvar HIGH_MIN_NORMAL_EXP = 0x00100000|0; // asm type annotation\n\n// 0x3fe00000 = 1071644672 => 0 01111111110 00000000000000000000 => biased exponent: 1022 = -1+1023 => 2^-1\nvar HIGH_BIASED_EXP_NEG_1 = 0x3fe00000|0; // asm type annotation\n\n// TODO: consider making into an external constant\nvar HIGH_NUM_SIGNIFICAND_BITS = 20|0; // asm type annotation\n\n// High: LN2\nvar LN2_HI = 6.93147182464599609375e-01; // 0x3FE62E43, 0x00000000\n\n// Low: LN2\nvar LN2_LO = -1.90465429995776804525e-09; // 0xBE205C61, 0x0CA86C39\n\n\n// MAIN //\n\n/**\n* Computes \\\\(2^{\\mathrm{hp} + \\mathrm{lp}\\\\).\n*\n* @private\n* @param {number} j - high word of `hp + lp`\n* @param {number} hp - first power summand\n* @param {number} lp - second power summand\n* @returns {number} function value\n*\n* @example\n* var z = pow2( 1065961648, -0.3398475646972656, -0.000002438187359100815 );\n* // returns ~0.79\n*/\nfunction pow2( j, hp, lp ) {\n\tvar tmp;\n\tvar t1;\n\tvar t;\n\tvar r;\n\tvar u;\n\tvar v;\n\tvar w;\n\tvar z;\n\tvar n;\n\tvar i;\n\tvar k;\n\n\ti = (j & ABS_MASK)|0; // asm type annotation\n\tk = ((i>>HIGH_NUM_SIGNIFICAND_BITS) - BIAS)|0; // asm type annotation\n\tn = 0;\n\n\t// `|z| > 0.5`, set `n = z+0.5`\n\tif ( i > HIGH_BIASED_EXP_NEG_1 ) {\n\t\tn = (j + (HIGH_MIN_NORMAL_EXP>>(k+1)))>>>0; // asm type annotation\n\t\tk = (((n & ABS_MASK)>>HIGH_NUM_SIGNIFICAND_BITS) - BIAS)|0; // new k for n\n\t\ttmp = ((n & ~(HIGH_SIGNIFICAND_MASK >> k)))>>>0; // asm type annotation\n\t\tt = setHighWord( 0.0, tmp );\n\t\tn = (((n & HIGH_SIGNIFICAND_MASK)|HIGH_MIN_NORMAL_EXP) >> (HIGH_NUM_SIGNIFICAND_BITS-k))>>>0; // eslint-disable-line max-len\n\t\tif ( j < 0 ) {\n\t\t\tn = -n;\n\t\t}\n\t\thp -= t;\n\t}\n\tt = lp + hp;\n\tt = setLowWord( t, 0 );\n\tu = t * LN2_HI;\n\tv = ( (lp - (t-hp))*LN2 ) + ( t*LN2_LO );\n\tz = u + v;\n\tw = v - (z - u);\n\tt = z * z;\n\tt1 = z - ( t*polyvalP( t ) );\n\tr = ( (z*t1) / (t1-2.0) ) - ( w + (z*w) );\n\tz = 1.0 - (r - z);\n\tj = getHighWord( z );\n\tj = uint32ToInt32( j );\n\tj += (n << HIGH_NUM_SIGNIFICAND_BITS)>>>0; // asm type annotation\n\n\t// Check for subnormal output...\n\tif ( (j>>HIGH_NUM_SIGNIFICAND_BITS) <= 0 ) {\n\t\tz = ldexp( z, n );\n\t} else {\n\t\tz = setHighWord( z, j );\n\t}\n\treturn z;\n}\n\n\n// EXPORTS //\n\nexport default pow2;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isnan from '@stdlib/math-base-assert-is-nan';\nimport isOdd from '@stdlib/math-base-assert-is-odd';\nimport isInfinite from '@stdlib/math-base-assert-is-infinite';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport sqrt from '@stdlib/math-base-special-sqrt';\nimport abs from '@stdlib/math-base-special-abs';\nimport toWords from '@stdlib/number-float64-base-to-words';\nimport setLowWord from '@stdlib/number-float64-base-set-low-word';\nimport uint32ToInt32 from '@stdlib/number-uint32-base-to-int32';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport PINF from '@stdlib/constants-float64-pinf';\nimport ABS_MASK from '@stdlib/constants-float64-high-word-abs-mask';\nimport xIsZero from './x_is_zero.js';\nimport yIsHuge from './y_is_huge.js';\nimport yIsInfinite from './y_is_infinite.js';\nimport log2ax from './log2ax.js';\nimport logx from './logx.js';\nimport pow2 from './pow2.js';\n\n\n// VARIABLES //\n\n// 0x3fefffff = 1072693247 => 0 01111111110 11111111111111111111 => biased exponent: 1022 = -1+1023 => 2^-1\nvar HIGH_MAX_NEAR_UNITY = 0x3fefffff|0; // asm type annotation\n\n// 0x41e00000 = 1105199104 => 0 10000011110 00000000000000000000 => biased exponent: 1054 = 31+1023 => 2^31\nvar HIGH_BIASED_EXP_31 = 0x41e00000|0; // asm type annotation\n\n// 0x43f00000 = 1139802112 => 0 10000111111 00000000000000000000 => biased exponent: 1087 = 64+1023 => 2^64\nvar HIGH_BIASED_EXP_64 = 0x43f00000|0; // asm type annotation\n\n// 0x40900000 = 1083179008 => 0 10000001001 00000000000000000000 => biased exponent: 1033 = 10+1023 => 2^10 = 1024\nvar HIGH_BIASED_EXP_10 = 0x40900000|0; // asm type annotation\n\n// 0x3ff00000 = 1072693248 => 0 01111111111 00000000000000000000 => biased exponent: 1023 = 0+1023 => 2^0 = 1\nvar HIGH_BIASED_EXP_0 = 0x3ff00000|0; // asm type annotation\n\n// 0x4090cc00 = 1083231232 => 0 10000001001 00001100110000000000\nvar HIGH_1075 = 0x4090cc00|0; // asm type annotation\n\n// 0xc090cc00 = 3230714880 => 1 10000001001 00001100110000000000\nvar HIGH_NEG_1075 = 0xc090cc00>>>0; // asm type annotation\n\nvar HIGH_NUM_NONSIGN_BITS = 31|0; // asm type annotation\n\nvar HUGE = 1.0e300;\nvar TINY = 1.0e-300;\n\n// -(1024-log2(ovfl+.5ulp))\nvar OVT = 8.0085662595372944372e-17;\n\n// High/low words workspace:\nvar WORDS = [ 0|0, 0|0 ];\n\n// Log workspace:\nvar LOG_WORKSPACE = [ 0.0, 0.0 ];\n\n\n// MAIN //\n\n/**\n* Evaluates the exponential function.\n*\n* ## Method\n*\n* 1. Let \\\\(x = 2^n (1+f)\\\\).\n*\n* 2. Compute \\\\(\\operatorname{log2}(x)\\\\) as\n*\n* ```tex\n* \\operatorname{log2}(x) = w_1 + w_2\n* ```\n*\n* where \\\\(w_1\\\\) has \\\\(53 - 24 = 29\\\\) bit trailing zeros.\n*\n* 3. Compute\n*\n* ```tex\n* y \\cdot \\operatorname{log2}(x) = n + y^\\prime\n* ```\n*\n* by simulating multi-precision arithmetic, where \\\\(|y^\\prime| \\leq 0.5\\\\).\n*\n* 4. Return\n*\n* ```tex\n* x^y = 2^n e^{y^\\prime \\cdot \\mathrm{log2}}\n* ```\n*\n* ## Special Cases\n*\n* ```tex\n* \\begin{align*}\n* x^{\\mathrm{NaN}} &= \\mathrm{NaN} & \\\\\n* (\\mathrm{NaN})^y &= \\mathrm{NaN} & \\\\\n* 1^y &= 1 & \\\\\n* x^0 &= 1 & \\\\\n* x^1 &= x & \\\\\n* (\\pm 0)^\\infty &= +0 & \\\\\n* (\\pm 0)^{-\\infty} &= +\\infty & \\\\\n* (+0)^y &= +0 & \\mathrm{if}\\ y > 0 \\\\\n* (+0)^y &= +\\infty & \\mathrm{if}\\ y < 0 \\\\\n* (-0)^y &= -\\infty & \\mathrm{if}\\ y\\ \\mathrm{is\\ an\\ odd\\ integer\\ and}\\ y < 0 \\\\\n* (-0)^y &= +\\infty & \\mathrm{if}\\ y\\ \\mathrm{is\\ not\\ an\\ odd\\ integer\\ and}\\ y < 0 \\\\\n* (-0)^y &= -0 & \\mathrm{if}\\ y\\ \\mathrm{is\\ an\\ odd\\ integer\\ and}\\ y > 0 \\\\\n* (-0)^y &= +0 & \\mathrm{if}\\ y\\ \\mathrm{is\\ not\\ an\\ odd\\ integer\\ and}\\ y > 0 \\\\\n* (-1)^{\\pm\\infty} &= \\mathrm{NaN} & \\\\\n* x^{\\infty} &= +\\infty & |x| > 1 \\\\\n* x^{\\infty} &= +0 & |x| < 1 \\\\\n* x^{-\\infty} &= +0 & |x| > 1 \\\\\n* x^{-\\infty} &= +\\infty & |x| < 1 \\\\\n* (-\\infty)^y &= (-0)^y & \\\\\n* \\infty^y &= +0 & y < 0 \\\\\n* \\infty^y &= +\\infty & y > 0 \\\\\n* x^y &= \\mathrm{NaN} & \\mathrm{if}\\ y\\ \\mathrm{is\\ not\\ a\\ finite\\ integer\\ and}\\ x < 0\n* \\end{align*}\n* ```\n*\n* ## Notes\n*\n* - \\\\(\\operatorname{pow}(x,y)\\\\) returns \\\\(x^y\\\\) nearly rounded. In particular, \\\\(\\operatorname{pow}(<\\mathrm{integer}>,<\\mathrm{integer}>)\\\\) **always** returns the correct integer, provided the value is representable.\n* - The hexadecimal values shown in the source code are the intended values for used constants. Decimal values may be used, provided the compiler will accurately convert decimal to binary in order to produce the hexadecimal values.\n*\n* @param {number} x - base\n* @param {number} y - exponent\n* @returns {number} function value\n*\n* @example\n* var v = pow( 2.0, 3.0 );\n* // returns 8.0\n*\n* @example\n* var v = pow( 4.0, 0.5 );\n* // returns 2.0\n*\n* @example\n* var v = pow( 100.0, 0.0 );\n* // returns 1.0\n*\n* @example\n* var v = pow( 3.141592653589793, 5.0 );\n* // returns ~306.0197\n*\n* @example\n* var v = pow( 3.141592653589793, -0.2 );\n* // returns ~0.7954\n*\n* @example\n* var v = pow( NaN, 3.0 );\n* // returns NaN\n*\n* @example\n* var v = pow( 5.0, NaN );\n* // returns NaN\n*\n* @example\n* var v = pow( NaN, NaN );\n* // returns NaN\n*/\nfunction pow( x, y ) {\n\tvar ahx; // absolute value high word `x`\n\tvar ahy; // absolute value high word `y`\n\tvar ax; // absolute value `x`\n\tvar hx; // high word `x`\n\tvar lx; // low word `x`\n\tvar hy; // high word `y`\n\tvar ly; // low word `y`\n\tvar sx; // sign `x`\n\tvar sy; // sign `y`\n\tvar y1;\n\tvar hp;\n\tvar lp;\n\tvar t;\n\tvar z; // y prime\n\tvar j;\n\tvar i;\n\tif ( isnan( x ) || isnan( y ) ) {\n\t\treturn NaN;\n\t}\n\t// Split `y` into high and low words:\n\ttoWords.assign( y, WORDS, 1, 0 );\n\thy = WORDS[ 0 ];\n\tly = WORDS[ 1 ];\n\n\t// Special cases `y`...\n\tif ( ly === 0 ) {\n\t\tif ( y === 0.0 ) {\n\t\t\treturn 1.0;\n\t\t}\n\t\tif ( y === 1.0 ) {\n\t\t\treturn x;\n\t\t}\n\t\tif ( y === -1.0 ) {\n\t\t\treturn 1.0 / x;\n\t\t}\n\t\tif ( y === 0.5 ) {\n\t\t\treturn sqrt( x );\n\t\t}\n\t\tif ( y === -0.5 ) {\n\t\t\treturn 1.0 / sqrt( x );\n\t\t}\n\t\tif ( y === 2.0 ) {\n\t\t\treturn x * x;\n\t\t}\n\t\tif ( y === 3.0 ) {\n\t\t\treturn x * x * x;\n\t\t}\n\t\tif ( y === 4.0 ) {\n\t\t\tx *= x;\n\t\t\treturn x * x;\n\t\t}\n\t\tif ( isInfinite( y ) ) {\n\t\t\treturn yIsInfinite( x, y );\n\t\t}\n\t}\n\t// Split `x` into high and low words:\n\ttoWords.assign( x, WORDS, 1, 0 );\n\thx = WORDS[ 0 ];\n\tlx = WORDS[ 1 ];\n\n\t// Special cases `x`...\n\tif ( lx === 0 ) {\n\t\tif ( hx === 0 ) {\n\t\t\treturn xIsZero( x, y );\n\t\t}\n\t\tif ( x === 1.0 ) {\n\t\t\treturn 1.0;\n\t\t}\n\t\tif (\n\t\t\tx === -1.0 &&\n\t\t\tisOdd( y )\n\t\t) {\n\t\t\treturn -1.0;\n\t\t}\n\t\tif ( isInfinite( x ) ) {\n\t\t\tif ( x === NINF ) {\n\t\t\t\t// `pow( 1/x, -y )`\n\t\t\t\treturn pow( -0.0, -y );\n\t\t\t}\n\t\t\tif ( y < 0.0 ) {\n\t\t\t\treturn 0.0;\n\t\t\t}\n\t\t\treturn PINF;\n\t\t}\n\t}\n\tif (\n\t\tx < 0.0 &&\n\t\tisInteger( y ) === false\n\t) {\n\t\t// Signal NaN...\n\t\treturn (x-x)/(x-x);\n\t}\n\tax = abs( x );\n\n\t// Remove the sign bits (i.e., get absolute values):\n\tahx = (hx & ABS_MASK)|0; // asm type annotation\n\tahy = (hy & ABS_MASK)|0; // asm type annotation\n\n\t// Extract the sign bits:\n\tsx = (hx >>> HIGH_NUM_NONSIGN_BITS)|0; // asm type annotation\n\tsy = (hy >>> HIGH_NUM_NONSIGN_BITS)|0; // asm type annotation\n\n\t// Determine the sign of the result...\n\tif ( sx && isOdd( y ) ) {\n\t\tsx = -1.0;\n\t} else {\n\t\tsx = 1.0;\n\t}\n\t// Case 1: `|y|` is huge...\n\n\t// |y| > 2^31\n\tif ( ahy > HIGH_BIASED_EXP_31 ) {\n\t\t// `|y| > 2^64`, then must over- or underflow...\n\t\tif ( ahy > HIGH_BIASED_EXP_64 ) {\n\t\t\treturn yIsHuge( x, y );\n\t\t}\n\t\t// Over- or underflow if `x` is not close to unity...\n\n\t\tif ( ahx < HIGH_MAX_NEAR_UNITY ) {\n\t\t\t// y < 0\n\t\t\tif ( sy === 1 ) {\n\t\t\t\t// Signal overflow...\n\t\t\t\treturn sx * HUGE * HUGE;\n\t\t\t}\n\t\t\t// Signal underflow...\n\t\t\treturn sx * TINY * TINY;\n\t\t}\n\t\tif ( ahx > HIGH_BIASED_EXP_0 ) {\n\t\t\t// y > 0\n\t\t\tif ( sy === 0 ) {\n\t\t\t\t// Signal overflow...\n\t\t\t\treturn sx * HUGE * HUGE;\n\t\t\t}\n\t\t\t// Signal underflow...\n\t\t\treturn sx * TINY * TINY;\n\t\t}\n\t\t// At this point, `|1-x|` is tiny (`<= 2^-20`). Suffice to compute `log(x)` by `x - x^2/2 + x^3/3 - x^4/4`.\n\t\tt = logx( LOG_WORKSPACE, ax );\n\t}\n\t// Case 2: `|y|` is not huge...\n\telse {\n\t\tt = log2ax( LOG_WORKSPACE, ax, ahx );\n\t}\n\t// Split `y` into `y1 + y2` and compute `(y1+y2) * (t1+t2)`...\n\ty1 = setLowWord( y, 0 );\n\tlp = ( (y-y1)*t[0] ) + ( y*t[1] );\n\thp = y1 * t[0];\n\tz = lp + hp;\n\n\t// Note: *can* be more performant to use `getHighWord` and `getLowWord` directly, but using `toWords` looks cleaner.\n\ttoWords.assign( z, WORDS, 1, 0 );\n\tj = uint32ToInt32( WORDS[0] );\n\ti = uint32ToInt32( WORDS[1] );\n\n\t// z >= 1024\n\tif ( j >= HIGH_BIASED_EXP_10 ) {\n\t\t// z > 1024\n\t\tif ( ((j-HIGH_BIASED_EXP_10)|i) !== 0 ) {\n\t\t\t// Signal overflow...\n\t\t\treturn sx * HUGE * HUGE;\n\t\t}\n\t\tif ( (lp+OVT) > (z-hp) ) {\n\t\t\t// Signal overflow...\n\t\t\treturn sx * HUGE * HUGE;\n\t\t}\n\t}\n\t// z <= -1075\n\telse if ( (j&ABS_MASK) >= HIGH_1075 ) {\n\t\t// z < -1075\n\t\tif ( ((j-HIGH_NEG_1075)|i) !== 0 ) {\n\t\t\t// Signal underflow...\n\t\t\treturn sx * TINY * TINY;\n\t\t}\n\t\tif ( lp <= (z-hp) ) {\n\t\t\t// Signal underflow...\n\t\t\treturn sx * TINY * TINY;\n\t\t}\n\t}\n\t// Compute `2^(hp+lp)`...\n\tz = pow2( j, hp, lp );\n\n\treturn sx * z;\n}\n\n\n// EXPORTS //\n\nexport default pow;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport abs from '@stdlib/math-base-special-abs';\nimport PINF from '@stdlib/constants-float64-pinf';\n\n\n// MAIN //\n\n/**\n* Evaluates the exponential function when \\\\( y = \\pm \\infty\\\\).\n*\n* @private\n* @param {number} x - base\n* @param {number} y - exponent\n* @returns {number} function value\n*\n* @example\n* var v = pow( -1.0, Infinity );\n* // returns NaN\n*\n* @example\n* var v = pow( -1.0, -Infinity );\n* // returns NaN\n*\n* @example\n* var v = pow( 1.0, Infinity );\n* // returns 1.0\n*\n* @example\n* var v = pow( 1.0, -Infinity );\n* // returns 1.0\n*\n* @example\n* var v = pow( 0.5, Infinity );\n* // returns 0.0\n*\n* @example\n* var v = pow( 0.5, -Infinity );\n* // returns Infinity\n*\n* @example\n* var v = pow( 1.5, -Infinity );\n* // returns 0.0\n*\n* @example\n* var v = pow( 1.5, Infinity );\n* // returns Infinity\n*/\nfunction pow( x, y ) {\n\tif ( x === -1.0 ) {\n\t\t// Julia (0.4.2) and Python (2.7.9) return `1.0` (WTF???). JavaScript (`Math.pow`), R, and libm return `NaN`. We choose `NaN`, as the value is indeterminate; i.e., we cannot determine whether `y` is odd, even, or somewhere in between.\n\t\treturn (x-x)/(x-x); // signal NaN\n\t}\n\tif ( x === 1.0 ) {\n\t\treturn 1.0;\n\t}\n\t// (|x| > 1 && y === NINF) || (|x| < 1 && y === PINF)\n\tif ( (abs(x) < 1.0) === (y === PINF) ) {\n\t\treturn 0.0;\n\t}\n\t// (|x| > 1 && y === PINF) || (|x| < 1 && y === NINF)\n\treturn PINF;\n}\n\n\n// EXPORTS //\n\nexport default pow;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isOdd from '@stdlib/math-base-assert-is-odd';\nimport copysign from '@stdlib/math-base-special-copysign';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport PINF from '@stdlib/constants-float64-pinf';\n\n\n// MAIN //\n\n/**\n* Evaluates the exponential function when \\\\(|x| = 0\\\\).\n*\n* @private\n* @param {number} x - base\n* @param {number} y - exponent\n* @returns {number} function value\n*\n* @example\n* var v = pow( 0.0, 2 );\n* // returns 0.0\n*\n* @example\n* var v = pow( -0.0, -9 );\n* // returns -Infinity\n*\n* @example\n* var v = pow( 0.0, -9 );\n* // returns Infinity\n*\n* @example\n* var v = pow( -0.0, 9 );\n* // returns 0.0\n*\n* @example\n* var v = pow( 0.0, -Infinity );\n* // returns Infinity\n*\n* @example\n* var v = pow( 0.0, Infinity );\n* // returns 0.0\n*/\nfunction pow( x, y ) {\n\tif ( y === NINF ) {\n\t\treturn PINF;\n\t}\n\tif ( y === PINF ) {\n\t\treturn 0.0;\n\t}\n\tif ( y > 0.0 ) {\n\t\tif ( isOdd( y ) ) {\n\t\t\treturn x; // handles +-0\n\t\t}\n\t\treturn 0.0;\n\t}\n\t// y < 0.0\n\tif ( isOdd( y ) ) {\n\t\treturn copysign( PINF, x ); // handles +-0\n\t}\n\treturn PINF;\n}\n\n\n// EXPORTS //\n\nexport default pow;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.5;\n\t}\n\treturn 0.5 + (x * (-0.3333333333333333 + (x * 0.25)));\n}\n\n\n// EXPORTS //\n\nexport default evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.5999999999999946;\n\t}\n\treturn 0.5999999999999946 + (x * (0.4285714285785502 + (x * (0.33333332981837743 + (x * (0.272728123808534 + (x * (0.23066074577556175 + (x * 0.20697501780033842))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.16666666666666602;\n\t}\n\treturn 0.16666666666666602 + (x * (-0.0027777777777015593 + (x * (0.00006613756321437934 + (x * (-0.0000016533902205465252 + (x * 4.1381367970572385e-8))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward positive infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = ceil( -4.2 );\n* // returns -4.0\n*\n* @example\n* var v = ceil( 9.99999 );\n* // returns 10.0\n*\n* @example\n* var v = ceil( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = ceil( NaN );\n* // returns NaN\n*/\nvar ceil = Math.ceil; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default ceil;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/12.2.0/lib/msun/src/e_log2.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getHighWord from '@stdlib/number-float64-base-get-high-word';\nimport setHighWord from '@stdlib/number-float64-base-set-high-word';\nimport setLowWord from '@stdlib/number-float64-base-set-low-word';\nimport toWords from '@stdlib/number-float64-base-to-words';\nimport isnan from '@stdlib/math-base-assert-is-nan';\nimport ABS_MASK from '@stdlib/constants-float64-high-word-abs-mask';\nimport HIGH_SIGNIFICAND_MASK from '@stdlib/constants-float64-high-word-significand-mask';\nimport BIAS from '@stdlib/constants-float64-exponent-bias';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport kernelLog1p from '@stdlib/math-base-special-kernel-log1p';\n\n\n// VARIABLES //\n\nvar TWO54 = 1.80143985094819840000e+16; // 0x43500000, 0x00000000\nvar IVLN2HI = 1.44269504072144627571e+00; // 0x3ff71547, 0x65200000\nvar IVLN2LO = 1.67517131648865118353e-10; // 0x3de705fc, 0x2eefa200\n\n// 0x7ff00000 = 2146435072 => 0 11111111111 00000000000000000000 => biased exponent: 2047 = 1023+1023 => 2^1023\nvar HIGH_MAX_NORMAL_EXP = 0x7ff00000|0; // asm type annotation\n\n// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022\nvar HIGH_MIN_NORMAL_EXP = 0x00100000|0; // asm type annotation\n\n// 0x3ff00000 = 1072693248 => 0 01111111111 00000000000000000000 => biased exponent: 1023 = 0+1023 => 2^0 = 1\nvar HIGH_BIASED_EXP_0 = 0x3ff00000|0; // asm type annotation\n\n// High/low words workspace:\nvar WORDS = [ 0|0, 0|0 ];\n\n\n// MAIN //\n\n/**\n* Evaluates the binary logarithm (base two).\n*\n* @param {NonNegativeNumber} x - input value\n* @returns {number} function value\n*\n* @example\n* var v = log2( 4.0 );\n* // returns 2.0\n*\n* @example\n* var v = log2( 8.0 );\n* // returns 3.0\n*\n* @example\n* var v = log2( 0.0 );\n* // returns -Infinity\n*\n* @example\n* var v = log2( Infinity );\n* // returns Infinity\n*\n* @example\n* var v = log2( NaN );\n* // returns NaN\n*\n* @example\n* var v = log2( -4.0 );\n* // returns NaN\n*/\nfunction log2( x ) {\n\tvar valHi;\n\tvar valLo;\n\tvar hfsq;\n\tvar hx;\n\tvar lx;\n\tvar hi;\n\tvar lo;\n\tvar f;\n\tvar R;\n\tvar w;\n\tvar y;\n\tvar i;\n\tvar k;\n\n\tif ( isnan( x ) || x < 0.0 ) {\n\t\treturn NaN;\n\t}\n\ttoWords.assign( x, WORDS, 1, 0 );\n\thx = WORDS[ 0 ];\n\tlx = WORDS[ 1 ];\n\tk = 0|0; // asm type annotation\n\tif ( hx < HIGH_MIN_NORMAL_EXP ) {\n\t\t// Case: x < 2**-1022\n\t\tif ( ( (hx&ABS_MASK) | lx ) === 0 ) {\n\t\t\treturn NINF;\n\t\t}\n\t\tk -= 54|0; // asm type annotation\n\n\t\t// Subnormal number, scale up x:\n\t\tx *= TWO54;\n\t\thx = getHighWord( x );\n\t}\n\tif ( hx >= HIGH_MAX_NORMAL_EXP ) {\n\t\treturn x + x;\n\t}\n\t// Case: log(1) = +0\n\tif ( hx === HIGH_BIASED_EXP_0 && lx === 0 ) {\n\t\treturn 0.0;\n\t}\n\tk += ( (hx>>20) - BIAS )|0; // asm type annotation\n\thx &= HIGH_SIGNIFICAND_MASK;\n\ti = ( ( hx+0x95f64 ) & HIGH_MIN_NORMAL_EXP )|0; // asm type annotation\n\n\t// Normalize x or x/2...\n\tx = setHighWord( x, hx|(i^HIGH_BIASED_EXP_0) );\n\tk += (i>>20)|0; // asm type annotation\n\ty = k;\n\tf = x - 1.0;\n\thfsq = 0.5 * f * f;\n\tR = kernelLog1p( f );\n\n\t/*\n\t* Notes:\n\t*\n\t* - `f-hfsq` must (for args near `1`) be evaluated in extra precision to avoid a large cancellation when `x` is near `sqrt(2)` or `1/sqrt(2)`.This is fairly efficient since `f-hfsq` only depends on `f`, so can be evaluated in parallel with `R`. Not combining `hfsq` with `R` also keeps `R` small (though not as small as a true `lo` term would be), so that extra precision is not needed for terms involving `R`.\n\t* - When implemented in C, compiler bugs involving extra precision used to break Dekker's theorem for spitting `f-hfsq` as `hi+lo`. These problems are now automatically avoided as a side effect of the optimization of combining the Dekker splitting step with the clear-low-bits step.\n\t* - `y` must (for args near `sqrt(2)` and `1/sqrt(2)`) be added in extra precision to avoid a very large cancellation when `x` is very near these values. Unlike the above cancellations, this problem is specific to base `2`. It is strange that adding `+-1` is so much harder than adding `+-ln2` or `+-log10_2`.\n\t* - This implementation uses Dekker's theorem to normalize `y+val_hi`, so, when implemented in C, compiler bugs may reappear in some configurations.\n\t* - The multi-precision calculations for the multiplications are routine.\n\t*/\n\thi = f - hfsq;\n\thi = setLowWord( hi, 0 );\n\tlo = ( f - hi ) - hfsq + R;\n\tvalHi = hi * IVLN2HI;\n\tvalLo = ( ( lo + hi ) * IVLN2LO ) + ( lo * IVLN2HI );\n\n\tw = y + valHi;\n\tvalLo += ( y - w ) + valHi;\n\tvalHi = w;\n\n\treturn valLo + valHi;\n}\n\n\n// EXPORTS //\n\nexport default log2;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isnan from '@stdlib/math-base-assert-is-nan';\nimport isInfinite from '@stdlib/math-base-assert-is-infinite';\nimport pow from '@stdlib/math-base-special-pow';\nimport floor from '@stdlib/math-base-special-floor';\nimport ceil from '@stdlib/math-base-special-ceil';\nimport log2 from '@stdlib/math-base-special-log2';\nimport MAX_EXP from '@stdlib/constants-float64-max-base2-exponent';\nimport MIN_EXP_SUBNORMAL from '@stdlib/constants-float64-min-base2-exponent-subnormal';\nimport PINF from '@stdlib/constants-float64-pinf';\n\n\n// MAIN //\n\n/**\n* Rounds a numeric value to the nearest power of two toward positive infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = ceil2( 3.141592653589793 );\n* // returns 4.0\n*\n* @example\n* var v = ceil2( 9.0 );\n* // returns 16.0\n*\n* @example\n* var v = ceil2( -0.314 );\n* // returns -0.25\n*/\nfunction ceil2( x ) {\n\tvar sign;\n\tvar p;\n\tif (\n\t\tisnan( x ) ||\n\t\tisInfinite( x ) ||\n\t\tx === 0.0\n\t) {\n\t\treturn x;\n\t}\n\tif ( x < 0 ) {\n\t\tx = -x;\n\t\tsign = -1.0;\n\t} else {\n\t\tsign = 1.0;\n\t}\n\t// Solve the equation `2^p = x` for `p`:\n\tp = log2( x );\n\n\t// If provided the smallest subnormal, no rounding possible:\n\tif ( p === MIN_EXP_SUBNORMAL ) {\n\t\treturn x;\n\t}\n\t// Determine a power of two which rounds the input value toward positive infinity:\n\tif ( sign === -1.0 ) {\n\t\tp = floor( p );\n\t} else {\n\t\tp = ceil( p );\n\t}\n\t// Handle overflow:\n\tif ( p > MAX_EXP ) {\n\t\treturn PINF;\n\t}\n\treturn sign * pow( 2.0, p );\n}\n\n\n// EXPORTS //\n\nexport default ceil2;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/12.2.0/lib/msun/src/k_log.h}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport polyvalP from './polyval_p.js';\nimport polyvalQ from './polyval_q.js';\n\n\n// MAIN //\n\n/**\n* Computes `log(1+f) - f` for `1+f` in `~[sqrt(2)/2, sqrt(2)]`.\n*\n* ## Method\n*\n* This function is a helper function for computing logarithms in base \\\\(e\\\\), and what follows describes the overall strategy for doing so. The argument reduction and adding the final term of the polynomial are done by the caller for increased accuracy when different bases are used.\n*\n* 1. Argument Reduction. Find \\\\(k\\\\) and \\\\(f\\\\) such that\n*\n* ```tex\n* x = 2^k \\cdot (1+f)\n* ```\n*\n* where \\\\(\\sqrt(2)/2 < 1+f < \\sqrt(2)\\\\).\n*\n* 2. Approximation of \\\\(\\operatorname{log}(1+f)\\\\). Let\n*\n* ```tex\n* \\begin{align*}\n* s &= \\frac{f}{2+f} \\\\\n* &= 2s + \\frac{2}{3} s^3 + \\frac{2}{5} s^5 + \\ldots \\\\\n* &= 2s + s R\n* \\end{align*}\n* ```\n*\n* based on\n*\n* ```tex\n* \\operatorname{log}(1+f) &= \\operatorname{log}(1+s) - \\operatorname{log}(1-s)\n* ```\n*\n* We use a special Reme algorithm on \\\\(\\[0,0.1716]\\\\) to generate a polynomial of degree \\\\(14\\\\) to approximate \\\\(R\\\\). The maximum error of this polynomial approximation is bounded by \\\\(2^{-58.45}\\\\). In other words,\n*\n* ```tex\n* R(z) ~ L_{g1} s^2 + L_{g2} s^4 + L_{g3} s^6 + L_{g4} s^8 + L_{g5} s^{10} + L_{g6} s^{12} + L_{g7} s^{14}\n* ```\n*\n* where the values of \\\\(L_{g1}\\\\) to \\\\(L_{g7}\\\\) are the polynomial coefficients used in the program below and\n*\n* ```tex\n* L_{g1} s^2 + \\ldots + L_{g7} s^{14} - R(z) \\leq 2^{-58.45}\n* ```\n*\n* Note that\n*\n* ```tex\n* 2s = f - s \\cdot f = f - h_{fsq} + (s \\cdot h_{fsq})\n* ```\n*\n* where \\\\(h_{fsq} = f^{2}/2\\\\).\n*\n* In order to guarantee an error in \\\\(\\operatorname{log}\\\\) below 1 ulp, we compute \\\\(\\operatorname{log}\\\\) by\n*\n* ```tex\n* \\begin{align*}\n* \\operatorname{log}(1+f) &= f - s (f - R) & \\textrm{(if f is not too large)} \\\\\n* \\operatorname{log}(1+f) &= f - (h_{fsq} - s (h_{fsq}+R)) & \\textrm{(better accuracy)}\n* \\end{align*}\n*\n* 3. Finally,\n*\n* ```tex\n* \\begin{align*}\n* \\operatorname{log}(x) &= k \\cdot \\operatorname{ln2} + \\operatorname{log}(1+f) \\\\\n* &= k \\cdot \\operatorname{ln2}_{hi} + (f-(h_{fsq}-(s \\cdot (h_{fsq}+R) + k \\cdot \\operatorname{ln2}_{lo})))\n* \\end{align*}\n* ```\n*\n* Here, \\\\(\\operatorname{ln2}\\\\) is split into two floating point numbers:\n*\n* ```tex\n* \\operatorname{ln2} = \\operatorname{ln2}_{hi} + \\operatorname{ln2}_{lo}\n* ```\n*\n* where \\\\(n \\cdot \\operatorname{ln2}_{hi}\\\\) is always exact for \\\\(|n| < 2000\\\\).\n*\n* @param {number} f - input value\n* @returns {number} function value\n*\n* @example\n* var v = kernelLog1p( 1.0 );\n* // returns ~0.1931\n*\n* @example\n* var v = kernelLog1p( 1.4142135623730951 );\n* // returns ~0.4672\n*\n* @example\n* var v = kernelLog1p( NaN );\n* // returns NaN\n*/\nfunction kernelLog1p( f ) {\n\tvar hfsq;\n\tvar t1;\n\tvar t2;\n\tvar s;\n\tvar z;\n\tvar R;\n\tvar w;\n\n\ts = f / ( 2.0 + f );\n\tz = s * s;\n\tw = z * z;\n\tt1 = w * polyvalP( w );\n\tt2 = z * polyvalQ( w );\n\tR = t2 + t1;\n\thfsq = 0.5 * f * f;\n\treturn s * ( hfsq + R );\n}\n\n\n// EXPORTS //\n\nexport default kernelLog1p;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.3999999999940942;\n\t}\n\treturn 0.3999999999940942 + (x * (0.22222198432149784 + (x * 0.15313837699209373))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.6666666666666735;\n\t}\n\treturn 0.6666666666666735 + (x * (0.2857142874366239 + (x * (0.1818357216161805 + (x * 0.14798198605116586))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArray from '@stdlib/assert-is-array';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isTypedArrayLike from '@stdlib/assert-is-typed-array-like';\nimport isInteger from '@stdlib/assert-is-integer';\nimport format from '@stdlib/error-tools-fmtprodmsg';\nimport prependArray from './prepend_array.js';\nimport prependObject from './prepend_object.js';\nimport prependTypedArray from './prepend_typed_array.js';\n\n\n// MAIN //\n\n/**\n* Adds elements from one collection to the beginning of another collection.\n*\n* @param {Collection} collection1 - collection\n* @param {Collection} collection2 - collection containing elements to add\n* @throws {TypeError} first argument must be either an array, typed array, or an array-like object\n* @throws {TypeError} second argument must be an array-like object\n* @returns {Collection} updated collection\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( collection1, collection2 ) {\n\tif ( !isCollection( collection2 ) ) {\n\t\tthrow new TypeError( format( '1Wn2y', collection2 ) );\n\t}\n\tif ( isArray( collection1 ) ) {\n\t\treturn prependArray( collection1, collection2 );\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection1 ) ) {\n\t\treturn prependTypedArray( collection1, collection2 );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection1 !== null &&\n\t\ttypeof collection1 === 'object' &&\n\t\ttypeof collection1.length === 'number' &&\n\t\tisInteger( collection1.length ) &&\n\t\tcollection1.length >= 0\n\t) {\n\t\treturn prependObject( collection1, collection2 );\n\t}\n\tthrow new TypeError( format( '1WnAi', collection1 ) );\n}\n\n\n// EXPORTS //\n\nexport default prepend;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-array-max-typed-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a collection.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is a collection\n*\n* @example\n* var bool = isCollection( [] );\n* // returns true\n*\n* @example\n* var bool = isCollection( {} );\n* // returns false\n*/\nfunction isCollection( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isCollection;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of an array.\n*\n* @private\n* @param {Array} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {Array} input array\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( arr, items ) {\n\tvar i;\n\tfor ( i = items.length-1; i >= 0; i-- ) {\n\t\tarr.unshift( items[ i ] );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nexport default prepend;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport MAX from '@stdlib/constants-array-max-typed-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is typed-array-like.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is typed-array-like\n*\n* @example\n* var arr = {\n* 'BYTES_PER_ELEMENT': 8,\n* 'length': 10,\n* 'byteOffset': 0,\n* 'byteLength': 10\n* };\n* var val = isTypedArrayLike( arr );\n* // returns true\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var val = isTypedArrayLike( new Int8Array( 4 ) );\n* // returns true\n*\n* @example\n* var val = isTypedArrayLike( [] );\n* // returns false\n*\n* @example\n* var val = isTypedArrayLike( {} );\n* // returns false\n*\n* @example\n* var val = isTypedArrayLike( null );\n* // returns false\n*\n* @example\n* var val = isTypedArrayLike( 'beep' );\n* // returns false\n*/\nfunction isTypedArrayLike( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object' &&\n\t\tisNonNegativeInteger( value.length ) &&\n\t\tvalue.length <= MAX &&\n\t\ttypeof value.BYTES_PER_ELEMENT === 'number' &&\n\t\ttypeof value.byteOffset === 'number' &&\n\t\ttypeof value.byteLength === 'number'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isTypedArrayLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ArrayBuffer from '@stdlib/array-buffer';\nimport ceil2 from '@stdlib/math-base-special-ceil2'; // TODO: nextpow2\n\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of a typed array.\n*\n* ## Notes\n*\n* - If the underlying `ArrayBuffer` is too short, we need to copy the data to a new `ArrayBuffer`. To do so, we allocate a new `ArrayBuffer` in a manner similar to how `Arrays` are resized (i.e., allocate enough memory to hold `nextpow2(n)` elements).\n* - Beware that, if an ArrayBuffer view is preceded by one or more other views, the created view may contain elements from those views, thus resulting in possible mutation. Accordingly, providing a typed array view having a shared underlying `ArrayBuffer` may have unintended consequences (including security vulnerabilities).\n*\n* @private\n* @param {TypedArray} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {TypedArray} input array\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( arr, items ) {\n\tvar nbytes;\n\tvar ibytes;\n\tvar offset;\n\tvar total;\n\tvar len;\n\tvar buf;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tlen = arr.length;\n\tn = items.length;\n\n\tibytes = n * arr.BYTES_PER_ELEMENT;\n\toffset = arr.byteOffset;\n\n\tif ( offset < ibytes ) {\n\t\tnbytes = len * arr.BYTES_PER_ELEMENT;\n\t\ttotal = nbytes + ibytes + offset;\n\t\tbuf = new ArrayBuffer( ceil2( total+1 ) );\n\t\toffset = buf.byteLength - nbytes - ibytes;\n\t\tv = new arr.constructor( buf, offset, len+n );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv[ i+n ] = arr[ i ];\n\t\t}\n\t} else {\n\t\toffset -= ibytes;\n\t\tv = new arr.constructor( arr.buffer, offset, len+n );\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tv[ i ] = items[ i ];\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nexport default prepend;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @param {ArrayLike} items - items to add\n* @returns {Object} input object\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* obj = prepend( obj, [ 3.0, 4.0 ] );\n* // returns { 'length': 4, '0': 3.0, '1': 4.0, '2': 1.0, '3': 2.0 }\n*/\nfunction prepend( obj, items ) {\n\tvar len;\n\tvar n;\n\tvar i;\n\n\tlen = obj.length;\n\tn = items.length;\n\n\t// Shift all existing elements to the right...\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tobj[ i+n ] = obj[ i ];\n\t}\n\t// Add new elements...\n\tfor ( i = 0; i < n; i++ ) {\n\t\tobj[ i ] = items[ i ];\n\t}\n\tobj.length = len + n;\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nexport default prepend;\n"],"names":["FLG","Symbol","hasToStringTagSupport","toStringTag","toStr","Object","prototype","toString","has","hasOwnProperty","Sym","toStrTag","nativeClass","hasToStringTag","v","isOwn","tag","out","value","property","call","err","main$7","Array","isArray","floor","Math","isInteger","x","MAX_TYPED_ARRAY_LENGTH","main","defineProperty","isNumber","zeros","n","i","zeroPad","str","width","right","negative","pad","length","startsWithMinus","substr","lowercase","String","toLowerCase","uppercase","toUpperCase","formatInteger","token","base","specifier","arg","parseInt","isFinite","Error","precision","padRight","sign","alternate","charAt","abs","replace","RE_EXP_POS_DIGITS","RE_EXP_NEG_DIGITS","RE_ONLY_DIGITS","RE_DIGITS_BEFORE_EXP","RE_TRAILING_PERIOD_ZERO","RE_PERIOD_ZERO_EXP","RE_ZERO_BEFORE_EXP","formatDouble","digits","f","parseFloat","toExponential","toFixed","toPrecision","spaces","fromCharCode","isnan","initialize","flags","mapping","formatInterpolate","tokens","hasPeriod","flag","num","pos","j","TypeError","padZeros","indexOf","arguments","maxWidth","substring","RE","parse","match","formatTokenize","content","prev","exec","slice","lastIndex","push","format","args","tokenize","interpolate","apply","objectProtoype","defineGetter","__defineGetter__","defineSetter","__defineSetter__","lookupGetter","__lookupGetter__","lookupSetter","__lookupSetter__","defineProperty$1","hasDefinePropertySupport","builtin","obj","prop","descriptor","hasValue","hasGet","hasSet","__proto__","get","set","setNonEnumerableReadOnly","configurable","enumerable","writable","main$5","Number","test","isPrimitive","isObject","setReadOnly","FLOAT64_PINF","POSITIVE_INFINITY","FLOAT64_NINF","NEGATIVE_INFINITY","PINF","NINF","isInt","valueOf","isNonNegativeInteger","fmtprodmsg","a","u","encodeURIComponent","ctor","hasArrayBuffer","ArrayBuffer","hasFloat64Array","Float64Array","bool","arr","GlobalFloat64Array","NaN","hasFloat64ArraySupport","Float64Array$1","view","buf","GlobalArrayBuffer","isView","byteLength","hasArrayBufferSupport","ArrayBuffer$1","isInfinite","isEven","isOdd","sqrt","hasUint32Array","Uint32Array","GlobalUint32Array","UINT32_MAX","hasUint32ArraySupport","Uint32Array$1","hasUint8Array","Uint8Array","GlobalUint8Array","UINT8_MAX","hasUint8ArraySupport","Uint8Array$1","hasUint16Array","Uint16Array","GlobalUint16Array","UINT16_MAX","hasUint16ArraySupport","uint16view","ctors","uint16","uint8","HIGH","LOW","IS_LITTLE_ENDIAN","buffer","isLittleEndian","indices$3","FLOAT64_VIEW","UINT32_VIEW","indices","toWords","stride","offset","fcn","assign","LOW$3","setLowWord","low","uint32ToInt32","FLOAT64_HIGH_WORD_ABS_MASK","FLOAT64_HIGH_WORD_SIGN_MASK","HIGH$5","getHighWord","indices$1","fromWords","high","WORDS","copysign","y","hx","hy","ABS_MASK","SIGN_MASK","HIGH_MAX_NEAR_UNITY","HUGE","TINY","HIGH$1","setHighWord","FLOAT64_EXPONENT_BIAS","HIGH_SIGNIFICAND_MASK","HIGH_MIN_NORMAL_EXP","HIGH_BIASED_EXP_0","HIGH_BIASED_EXP_NEG_512","HIGH_SIGNIFICAND_HALF","HIGH_NUM_SIGNIFICAND_BITS","TWO53","CP","CP_HI","CP_LO","BP","DP_HI","DP_LO","INV_LN2","INV_LN2_HI","INV_LN2_LO","FLOAT64_MAX_BASE2_EXPONENT","FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL","FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL","FLOAT64_SMALLEST_NORMAL","SCALAR","normalize","FLOAT64_HIGH_WORD_EXPONENT_MASK","TWO52_INV","CLEAR_EXP_MASK","FRAC","ldexp","frac","exp","m","EXP_MASK","BIAS","floatExp","MIN_SUBNORMAL_EXPONENT","MAX_EXPONENT","MAX_SUBNORMAL_EXPONENT","LN2","FLOAT64_HIGH_WORD_SIGNIFICAND_MASK","HIGH_BIASED_EXP_NEG_1","LN2_HI","LN2_LO","HIGH_BIASED_EXP_31","HIGH_BIASED_EXP_64","HIGH_BIASED_EXP_10","HIGH_1075","HIGH_NEG_1075","HIGH_NUM_NONSIGN_BITS","OVT","LOG_WORKSPACE","pow","ahx","ahy","ax","sx","sy","y1","hp","lp","t","z","yIsInfinite","xIsZero","yIsHuge","t2","t1","w","logx","tmp","ss","s2","hs","ls","ht","bp","dp","hz","lz","r","k","log2ax","pow2","ceil","TWO54","IVLN2HI","IVLN2LO","HIGH_MAX_NORMAL_EXP","ceil2","p","valHi","valLo","hfsq","lx","hi","lo","R","s","polyvalQ","kernelLog1p","log2","MIN_EXP_SUBNORMAL","MAX_EXP","collection1","collection2","MAX_LENGTH","items","unshift","prependArray","MAX","BYTES_PER_ELEMENT","byteOffset","isTypedArrayLike","nbytes","ibytes","len","constructor","prependTypedArray","prependObject"],"mappings":";yCA2BA,IAAIA,ECMgB,mBAAXC,QACoB,iBAApBA,OAAQ,ODOjB,SAASC,IACR,OAASF,GAAqC,iBAAvBC,OAAOE,WAC/B,CErBA,IAAIC,EAAQC,OAAOC,UAAUC,SCAzBC,EAAMH,OAAOC,UAAUG,eCAvBC,EAA0B,mBAAXT,OAA0BA,YAAS,ECKlDU,EAA+B,mBAAXV,EAA0BA,EAAOE,YAAc,GCiCvES,EATKC,ICDL,SAAsBC,GACrB,IAAIC,EACAC,EACAC,EJHgBC,EAAOC,EIK3B,GAAKL,QACJ,OAAOV,EAAMgB,KAAMN,GAEpBE,EAAMF,EAAGX,GJRkBgB,EISJhB,EAAvBY,EJPCG,OAFmBA,EISAJ,IJFbN,EAAIY,KAAMF,EAAOC,GIKxB,IACCL,EAAGX,QAAgB,CACnB,CAAC,MAAQkB,GACT,OAAOjB,EAAMgB,KAAMN,EACnB,CAQD,OAPAG,EAAMb,EAAMgB,KAAMN,GAEbC,EACJD,EAAGX,GAAgBa,SAEZF,EAAGX,GAEJc,CACR,EC3BA,SAAsBH,GACrB,OAAOV,EAAM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34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134]}
\ No newline at end of file
diff --git a/dist/index.d.ts b/dist/index.d.ts
deleted file mode 100644
index 52155db..0000000
--- a/dist/index.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-///
-import prepend from '../docs/types/index';
-export = prepend;
\ No newline at end of file
diff --git a/dist/index.js b/dist/index.js
deleted file mode 100644
index 4bd891a..0000000
--- a/dist/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-"use strict";var v=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var h=v(function(C,g){
-function x(r,e){var n;for(n=e.length-1;n>=0;n--)r.unshift(e[n]);return r}g.exports=x
-});var E=v(function(F,d){
-function A(r,e){var n,a,t;for(n=r.length,a=e.length,t=n-1;t>=0;t--)r[t+a]=r[t];for(t=0;t=0)return P(r,e);throw new TypeError(T('1WnAi',r))}w.exports=V
-});var Y=m();module.exports=Y;
-/** @license Apache-2.0 */
-//# sourceMappingURL=index.js.map
diff --git a/dist/index.js.map b/dist/index.js.map
deleted file mode 100644
index d40da71..0000000
--- a/dist/index.js.map
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "version": 3,
- "sources": ["../lib/prepend_array.js", "../lib/prepend_object.js", "../lib/prepend_typed_array.js", "../lib/main.js", "../lib/index.js"],
- "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of an array.\n*\n* @private\n* @param {Array} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {Array} input array\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( arr, items ) {\n\tvar i;\n\tfor ( i = items.length-1; i >= 0; i-- ) {\n\t\tarr.unshift( items[ i ] );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prepend;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @param {ArrayLike} items - items to add\n* @returns {Object} input object\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* obj = prepend( obj, [ 3.0, 4.0 ] );\n* // returns { 'length': 4, '0': 3.0, '1': 4.0, '2': 1.0, '3': 2.0 }\n*/\nfunction prepend( obj, items ) {\n\tvar len;\n\tvar n;\n\tvar i;\n\n\tlen = obj.length;\n\tn = items.length;\n\n\t// Shift all existing elements to the right...\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tobj[ i+n ] = obj[ i ];\n\t}\n\t// Add new elements...\n\tfor ( i = 0; i < n; i++ ) {\n\t\tobj[ i ] = items[ i ];\n\t}\n\tobj.length = len + n;\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prepend;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ArrayBuffer = require( '@stdlib/array-buffer' );\nvar ceil2 = require( '@stdlib/math-base-special-ceil2' ); // TODO: nextpow2\n\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of a typed array.\n*\n* ## Notes\n*\n* - If the underlying `ArrayBuffer` is too short, we need to copy the data to a new `ArrayBuffer`. To do so, we allocate a new `ArrayBuffer` in a manner similar to how `Arrays` are resized (i.e., allocate enough memory to hold `nextpow2(n)` elements).\n* - Beware that, if an ArrayBuffer view is preceded by one or more other views, the created view may contain elements from those views, thus resulting in possible mutation. Accordingly, providing a typed array view having a shared underlying `ArrayBuffer` may have unintended consequences (including security vulnerabilities).\n*\n* @private\n* @param {TypedArray} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {TypedArray} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( arr, items ) {\n\tvar nbytes;\n\tvar ibytes;\n\tvar offset;\n\tvar total;\n\tvar len;\n\tvar buf;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tlen = arr.length;\n\tn = items.length;\n\n\tibytes = n * arr.BYTES_PER_ELEMENT;\n\toffset = arr.byteOffset;\n\n\tif ( offset < ibytes ) {\n\t\tnbytes = len * arr.BYTES_PER_ELEMENT;\n\t\ttotal = nbytes + ibytes + offset;\n\t\tbuf = new ArrayBuffer( ceil2( total+1 ) );\n\t\toffset = buf.byteLength - nbytes - ibytes;\n\t\tv = new arr.constructor( buf, offset, len+n );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv[ i+n ] = arr[ i ];\n\t\t}\n\t} else {\n\t\toffset -= ibytes;\n\t\tv = new arr.constructor( arr.buffer, offset, len+n );\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tv[ i ] = items[ i ];\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = prepend;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( '@stdlib/assert-is-array' );\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar isTypedArrayLike = require( '@stdlib/assert-is-typed-array-like' );\nvar isInteger = require( '@stdlib/assert-is-integer' );\nvar format = require( '@stdlib/string-format' );\nvar prependArray = require( './prepend_array.js' );\nvar prependObject = require( './prepend_object.js' );\nvar prependTypedArray = require( './prepend_typed_array.js' );\n\n\n// MAIN //\n\n/**\n* Adds elements from one collection to the beginning of another collection.\n*\n* @param {Collection} collection1 - collection\n* @param {Collection} collection2 - collection containing elements to add\n* @throws {TypeError} first argument must be either an array, typed array, or an array-like object\n* @throws {TypeError} second argument must be an array-like object\n* @returns {Collection} updated collection\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( collection1, collection2 ) {\n\tif ( !isCollection( collection2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', collection2 ) );\n\t}\n\tif ( isArray( collection1 ) ) {\n\t\treturn prependArray( collection1, collection2 );\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection1 ) ) {\n\t\treturn prependTypedArray( collection1, collection2 );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection1 !== null &&\n\t\ttypeof collection1 === 'object' &&\n\t\ttypeof collection1.length === 'number' &&\n\t\tisInteger( collection1.length ) &&\n\t\tcollection1.length >= 0\n\t) {\n\t\treturn prependObject( collection1, collection2 );\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.', collection1 ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = prepend;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add the elements of one collection to the beginning of another collection.\n*\n* @module @stdlib/utils-prepend\n*\n* @example\n* var prepend = require( '@stdlib/utils-prepend' );\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
- "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAoCA,SAASC,EAASC,EAAKC,EAAQ,CAC9B,IAAIC,EACJ,IAAMA,EAAID,EAAM,OAAO,EAAGC,GAAK,EAAGA,IACjCF,EAAI,QAASC,EAAOC,CAAE,CAAE,EAEzB,OAAOF,CACR,CAKAF,EAAO,QAAUC,IC/CjB,IAAAI,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAwCA,SAASC,EAASC,EAAKC,EAAQ,CAC9B,IAAIC,EACAC,EACAC,EAMJ,IAJAF,EAAMF,EAAI,OACVG,EAAIF,EAAM,OAGJG,EAAIF,EAAI,EAAGE,GAAK,EAAGA,IACxBJ,EAAKI,EAAED,CAAE,EAAIH,EAAKI,CAAE,EAGrB,IAAMA,E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,CAACT,EAAcS,CAAY,EAC/B,MAAM,IAAI,UAAWN,EAAQ,+EAAgFM,CAAY,CAAE,EAE5H,GAAKV,EAASS,CAAY,EACzB,OAAOJ,EAAcI,EAAaC,CAAY,EAG/C,GAAKR,EAAkBO,CAAY,EAClC,OAAOF,EAAmBE,EAAaC,CAAY,EAGpD,GACCD,IAAgB,MAChB,OAAOA,GAAgB,UACvB,OAAOA,EAAY,QAAW,UAC9BN,EAAWM,EAAY,MAAO,GAC9BA,EAAY,QAAU,EAEtB,OAAOH,EAAeG,EAAaC,CAAY,EAEhD,MAAM,IAAI,UAAWN,EAAQ,+GAAgHK,CAAY,CAAE,CAC5J,CAKAV,EAAO,QAAUS,IC1CjB,IAAIG,EAAO,IAKX,OAAO,QAAUA",
- "names": ["require_prepend_array", "__commonJSMin", "exports", "module", "prepend", "arr", "items", "i", "require_prepend_object", "__commonJSMin", "exports", "module", "prepend", "obj", "items", "len", "n", "i", "require_prepend_typed_array", "__commonJSMin", "exports", "module", "ArrayBuffer", "ceil2", "prepend", "arr", "items", "nbytes", "ibytes", "offset", "total", "len", "buf", "n", "v", "i", "require_main", "__commonJSMin", "exports", "module", "isArray", "isCollection", "isTypedArrayLike", "isInteger", "format", "prependArray", "prependObject", "prependTypedArray", "prepend", "collection1", "collection2", "main"]
-}
diff --git a/docs/repl.txt b/docs/repl.txt
deleted file mode 100644
index f308559..0000000
--- a/docs/repl.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-
-{{alias}}( collection1, collection2 )
- Adds the elements of one collection to the beginning of another collection.
-
- If the input collection is a typed array, the output value does not equal
- the input reference and the underlying `ArrayBuffer` may *not* be the same
- as the `ArrayBuffer` belonging to the input view.
-
- For purposes of generality, always treat the output collection as distinct
- from the input collection.
-
- Parameters
- ----------
- collection1: Array|TypedArray|Object
- A collection. If the collection is an `Object`, the collection should be
- array-like.
-
- collection2: Array|TypedArray|Object
- A collection containing the elements to add. If the collection is an
- `Object`, the collection should be array-like.
-
- Returns
- -------
- out: Array|TypedArray|Object
- Updated collection.
-
- Examples
- --------
- // Arrays:
- > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
- > arr = {{alias}}( arr, [ 6.0, 7.0 ] )
- [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
-
- // Typed arrays:
- > arr = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0 ] );
- > arr = {{alias}}( arr, [ 3.0, 4.0 ] )
- [ 3.0, 4.0, 1.0, 2.0 ]
-
- // Array-like object:
- > arr = { 'length': 1, '0': 1.0 };
- > arr = {{alias}}( arr, [ 2.0, 3.0 ] )
- { 'length': 3, '0': 2.0, '1': 3.0, '2': 1.0 }
-
- See Also
- --------
-
diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts
deleted file mode 100644
index 8c326e8..0000000
--- a/docs/types/index.d.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-* @license Apache-2.0
-*
-* Copyright (c) 2019 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-// TypeScript Version: 4.1
-
-///
-
-import { Collection } from '@stdlib/types/array';
-
-/**
-* Adds elements from one collection to the beginning of another collection.
-*
-* ## Notes
-*
-* - If the input collection is a typed array, the output value does not equal the input reference and the underlying `ArrayBuffer` may *not* be the same as the `ArrayBuffer` belonging to the input view.
-* - For purposes of generality, always treat the output collection as distinct from the input collection.
-*
-* @param collection1 - collection
-* @param collection2 - collection containing elements to add
-* @returns updated collection
-*
-* @example
-* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
-*
-* arr = prepend( arr, [ 6.0, 7.0 ] );
-* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
-*
-* @example
-* var Float64Array = require( '@stdlib/array-float64' );
-*
-* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
-* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
-*
-* arr = prepend( arr, [ 6.0, 7.0 ] );
-* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
-*/
-declare function prepend( collection1: Collection, collection2: Collection ): Collection;
-
-
-// EXPORTS //
-
-export = prepend;
diff --git a/docs/types/test.ts b/docs/types/test.ts
deleted file mode 100644
index 0cc99ff..0000000
--- a/docs/types/test.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-* @license Apache-2.0
-*
-* Copyright (c) 2019 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-import prepend = require( './index' );
-
-
-// TESTS //
-
-// The function returns a collection...
-{
- prepend( [ 0, 0 ], [ 1, 1 ] ); // $ExpectType Collection
- prepend( [ false, true ], [ 0, 1 ] ); // $ExpectType Collection
- prepend( [ 'abc', 'abc' ], [ 0, 1 ] ); // $ExpectType Collection
- prepend( [ true, true ], [ false, false ] ); // $ExpectType Collection
-}
-
-// The compiler throws an error if the function is provided a first argument which is not a collection...
-{
- prepend( true, [] ); // $ExpectError
- prepend( false, [] ); // $ExpectError
- prepend( 5, [] ); // $ExpectError
-}
-
-// The compiler throws an error if the function is provided a second argument which is not a collection...
-{
- prepend( [], true ); // $ExpectError
- prepend( [], false ); // $ExpectError
- prepend( [], 5 ); // $ExpectError
-}
-
-// The compiler throws an error if the function is not provided two arguments...
-{
- prepend(); // $ExpectError
- prepend( [ true, true ] ); // $ExpectError
- prepend( [ true, true ], [ true, false ], 3 ); // $ExpectError
-}
diff --git a/examples/index.js b/examples/index.js
deleted file mode 100644
index 835c157..0000000
--- a/examples/index.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-var Float64Array = require( '@stdlib/array-float64' );
-var prepend = require( './../lib' );
-
-var arr;
-var i;
-var j;
-
-arr = new Float64Array();
-for ( i = 0; i < 100; i++ ) {
- j = i * 3;
- arr = prepend( arr, [ j+2, j+1, j ] );
-}
-console.log( arr );
-console.log( 'View Length: %d', arr.byteLength );
-console.log( 'Buffer Length: %d', arr.buffer.byteLength );
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..31dabf9
--- /dev/null
+++ b/index.js
@@ -0,0 +1,3 @@
+// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
+var r,e;r=this,e=function(){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function e(){return r&&"symbol"==typeof Symbol.toStringTag}var n=Object.prototype.toString,t=Object.prototype.hasOwnProperty,i="function"==typeof Symbol?Symbol:void 0,o="function"==typeof i?i.toStringTag:"",a=e()?function(r){var e,i,a,u,f;if(null==r)return n.call(r);i=r[o],f=o,e=null!=(u=r)&&t.call(u,f);try{r[o]=void 0}catch(e){return n.call(r)}return a=n.call(r),e?r[o]=i:delete r[o],a}:function(r){return n.call(r)},u=Array.isArray?Array.isArray:function(r){return"[object Array]"===a(r)},f=Math.floor;function c(r){return f(r)===r}var s=9007199254740991,l="function"==typeof Object.defineProperty?Object.defineProperty:null,p=Object.defineProperty;function y(r){return"number"==typeof r}function g(r){var e,n="";for(e=0;e0&&(e-=1),n=t.toExponential(e)):n=t.toPrecision(r.precision),r.alternate||(n=E.call(n,x,"$1e"),n=E.call(n,I,"e"),n=E.call(n,U,""));break;default:throw new Error("invalid double notation. Value: "+r.specifier)}return n=E.call(n,_,"e+0$1"),n=E.call(n,j,"e-0$1"),r.alternate&&(n=E.call(n,S,"$1."),n=E.call(n,T,"$1.e")),t>=0&&r.sign&&(n=r.sign+n),n=r.specifier===A.call(r.specifier)?A.call(n):m.call(n)}function N(r){var e,n="";for(e=0;e127)throw new Error("invalid character code. Value: "+t.arg);t.arg=V(o)?String(t.arg):k(o)}break;case"e":case"E":case"f":case"F":case"g":case"G":e||(t.precision=6),t.arg=O(t);break;default:throw new Error("invalid specifier: "+t.specifier)}t.maxWidth>=0&&t.arg.length>t.maxWidth&&(t.arg=t.arg.substring(0,t.maxWidth)),t.padZeros?t.arg=h(t.arg,t.width||t.precision,t.padRight):t.width&&(t.arg=(s=t.arg,l=t.width,p=t.padRight,y=void 0,(y=l-s.length)<0?s:s=p?s+N(y):N(y)+s)),a+=t.arg||"",u+=1}return a}var B=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function R(r){var e={mapping:r[1]?parseInt(r[1],10):void 0,flags:r[2],width:r[3],precision:r[5],specifier:r[6]};return"."===r[4]&&void 0===r[5]&&(e.precision="1"),e}function W(r){var e,n,t,i;for(n=[],i=0,t=B.exec(r);t;)(e=r.slice(i,B.lastIndex-t[0].length)).length&&n.push(e),n.push(R(t)),i=B.lastIndex,t=B.exec(r);return(e=r.slice(i)).length&&n.push(e),n}function $(r){var e,n;if("string"!=typeof r)throw new TypeError($("invalid argument. First argument must be a string. Value: `%s`.",r));for(e=[W(r)],n=1;nnr&&c(r)}function ir(r){return z(r)&&tr(r)}function or(r){return Q(r)&&tr(r.valueOf())}function ar(r){return ir(r)||or(r)}function ur(r){return ir(r)&&r>=0}function fr(r){return or(r)&&r.valueOf()>=0}function cr(r){return ur(r)||fr(r)}function sr(){var r,e=arguments,n="https://stdlib.io/e/"+e[0]+"?";for(r=1;r0?r-1:r+1)}var Sr=Math.sqrt;function Tr(r){return Math.abs(r)}var Ur,Ir="function"==typeof Uint32Array,xr="function"==typeof Uint32Array?Uint32Array:null,Or="function"==typeof Uint32Array?Uint32Array:void 0;Ur=function(){var r,e,n;if("function"!=typeof xr)return!1;try{e=new xr(e=[1,3.14,-3.14,4294967296,4294967297]),n=e,r=(Ir&&n instanceof Uint32Array||"[object Uint32Array]"===a(n))&&1===e[0]&&3===e[1]&&4294967293===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?Or:function(){throw new Error("not implemented")};var Nr,kr=Ur,Fr="function"==typeof Uint8Array,Vr="function"==typeof Uint8Array?Uint8Array:null,Lr="function"==typeof Uint8Array?Uint8Array:void 0;Nr=function(){var r,e,n;if("function"!=typeof Vr)return!1;try{e=new Vr(e=[1,3.14,-3.14,256,257]),n=e,r=(Fr&&n instanceof Uint8Array||"[object Uint8Array]"===a(n))&&1===e[0]&&3===e[1]&&253===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?Lr:function(){throw new Error("not implemented")};var Pr,Br=Nr,Rr="function"==typeof Uint16Array,Wr="function"==typeof Uint16Array?Uint16Array:null,$r="function"==typeof Uint16Array?Uint16Array:void 0;Pr=function(){var r,e,n;if("function"!=typeof Wr)return!1;try{e=new Wr(e=[1,3.14,-3.14,65536,65537]),n=e,r=(Rr&&n instanceof Uint16Array||"[object Uint16Array]"===a(n))&&1===e[0]&&3===e[1]&&65533===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?$r:function(){throw new Error("not implemented")};var Gr,Cr={uint16:Pr,uint8:Br};(Gr=new Cr.uint16(1))[0]=4660;var Hr,Mr,Yr=52===new Cr.uint8(Gr.buffer)[0];!0===Yr?(Hr=1,Mr=0):(Hr=0,Mr=1);var Zr={HIGH:Hr,LOW:Mr},Xr=new vr(1),qr=new kr(Xr.buffer),zr=Zr.HIGH,Dr=Zr.LOW;function Jr(r,e,n,t){return Xr[0]=r,e[t]=qr[zr],e[t+n]=qr[Dr],e}function Kr(r){return Jr(r,[0,0],1,0)}q(Kr,"assign",Jr);var Qr=!0===Yr?0:1,re=new vr(1),ee=new kr(re.buffer);function ne(r,e){return re[0]=r,ee[Qr]=e>>>0,re[0]}function te(r){return 0|r}var ie,oe,ae=2147483647,ue=2147483648,fe=!0===Yr?1:0,ce=new vr(1),se=new kr(ce.buffer);function le(r){return ce[0]=r,se[fe]}!0===Yr?(ie=1,oe=0):(ie=0,oe=1);var pe={HIGH:ie,LOW:oe},ye=new vr(1),ge=new kr(ye.buffer),he=pe.HIGH,de=pe.LOW;function ve(r,e){return ge[he]=r,ge[de]=e,ye[0]}var be=[0,0];function we(r,e){var n,t;return Kr.assign(r,be,1,0),n=be[0],n&=ae,t=le(e),ve(n|=t&=ue,be[1])}var me=1072693247,Ae=1e300,Ee=1e-300,_e=!0===Yr?1:0,je=new vr(1),Se=new kr(je.buffer);function Te(r,e){return je[0]=r,Se[_e]=e>>>0,je[0]}var Ue=1023,Ie=1048575,xe=1048576,Oe=1072693248,Ne=536870912,ke=524288,Fe=20,Ve=9007199254740992,Le=.9617966939259756,Pe=.9617967009544373,Be=-7.028461650952758e-9,Re=[1,1.5],We=[0,.5849624872207642],$e=[0,1.350039202129749e-8],Ge=1.4426950408889634,Ce=1.4426950216293335,He=1.9259629911266175e-8,Me=1023,Ye=-1023,Ze=-1074,Xe=22250738585072014e-324,qe=4503599627370496;function ze(r,e,n,t){return Ar(r)||Er(r)?(e[t]=r,e[t+n]=0,e):0!==r&&Tr(r)>>20)-Ue|0}(r),eMe?r<0?nr:er:(e<=Ye?(e+=52,t=Je):t=1,Kr.assign(r,rn,1,0),n=rn[0],n&=Ke,t*ve(n|=e+Ue<<20,rn[1])))}var nn=.6931471805599453,tn=1048575,on=1048576,an=1071644672,un=20,fn=.6931471824645996,cn=-1.904654299957768e-9,sn=1072693247,ln=1105199104,pn=1139802112,yn=1083179008,gn=1072693248,hn=1083231232,dn=3230714880,vn=31,bn=1e300,wn=1e-300,mn=8008566259537294e-32,An=[0,0],En=[0,0];function _n(r,e){var n,t,i,o,a,u,f,s,l,p,y,g,h,d;if(Ar(r)||Ar(e))return NaN;if(Kr.assign(e,An,1,0),a=An[0],0===An[1]){if(0===e)return 1;if(1===e)return r;if(-1===e)return 1/r;if(.5===e)return Sr(r);if(-.5===e)return 1/Sr(r);if(2===e)return r*r;if(3===e)return r*r*r;if(4===e)return(r*=r)*r;if(Er(e))return function(r,e){return-1===r?(r-r)/(r-r):1===r?1:Tr(r)<1==(e===er)?0:er}(r,e)}if(Kr.assign(r,An,1,0),o=An[0],0===An[1]){if(0===o)return function(r,e){return e===nr?er:e===er?0:e>0?jr(e)?r:0:jr(e)?we(er,r):er}(r,e);if(1===r)return 1;if(-1===r&&jr(e))return-1;if(Er(r))return r===nr?_n(-0,-e):e<0?0:er}if(r<0&&!1===c(e))return(r-r)/(r-r);if(i=Tr(r),n=o&ae|0,t=a&ae|0,f=a>>>vn|0,u=(u=o>>>vn|0)&&jr(e)?-1:1,t>ln){if(t>pn)return function(r,e){return(le(r)&ae)<=me?e<0?Ae*Ae:Ee*Ee:e>0?Ae*Ae:Ee*Ee}(r,e);if(ngn)return 0===f?u*bn*bn:u*wn*wn;y=function(r,e){var n,t,i,o,a,u,f;return o=(i=e-1)*i*(0===(f=i)?.5:.5+f*(.25*f-.3333333333333333)),n=(u=i*He-o*Ge)-((t=ne(t=(a=Ce*i)+u,0))-a),r[0]=t,r[1]=n,r}(En,i)}else y=function(r,e,n){var t,i,o,a,u,f,c,s,l,p,y,g,h,d,v,b,w,m,A,E,_;return m=0,n>Fe)-Ue|0,n=(A=n&Ie|0)|Oe|0,A<=235662?E=0:A<767610?E=1:(E=0,m+=1,n-=xe),a=ne(i=(b=(e=Te(e,n))-(c=Re[E]))*(w=1/(e+c)),0),t=(n>>1|Ne)+ke,f=Te(0,t+=E<<18),v=(o=i*i)*o*(0===(_=o)?.5999999999999946:.5999999999999946+_*(.4285714285785502+_*(.33333332981837743+_*(.272728123808534+_*(.23066074577556175+.20697501780033842*_))))),f=ne(f=3+(o=a*a)+(v+=(u=w*(b-a*f-a*(e-(f-c))))*(a+i)),0),l=ne(l=(b=a*f)+(w=u*f+(v-(f-3-o))*i),0),p=Pe*l,h=(y=Be*l+(w-(l-b))*Le+$e[E])-((g=ne(g=p+y+(s=We[E])+(d=m),0))-d-s-p),r[0]=g,r[1]=h,r}(En,i,n);if(g=(p=(e-(s=ne(e,0)))*y[0]+e*y[1])+(l=s*y[0]),Kr.assign(g,An,1,0),h=te(An[0]),d=te(An[1]),h>=yn){if(0!=(h-yn|d))return u*bn*bn;if(p+mn>g-l)return u*bn*bn}else if((h&ae)>=hn){if(0!=(h-dn|d))return u*wn*wn;if(p<=g-l)return u*wn*wn}return g=function(r,e,n){var t,i,o,a,u,f,c,s,l,p;return l=((s=r&ae|0)>>un)-Ue|0,c=0,s>an&&(i=Te(0,((c=r+(on>>l+1)>>>0)&~(tn>>(l=((c&ae)>>un)-Ue|0)))>>>0),c=(c&tn|on)>>un-l>>>0,r<0&&(c=-c),e-=i),r=te(r=le(f=1-((f=(o=(i=ne(i=n+e,0))*fn)+(a=(n-(i-e))*nn+i*cn))*(t=f-(i=f*f)*(0===(p=i)?.16666666666666602:.16666666666666602+p*(p*(6613756321437934e-20+p*(4.1381367970572385e-8*p-16533902205465252e-22))-.0027777777777015593)))/(t-2)-((u=a-(f-o))+f*u)-f))),(r+=c<>>0)>>un<=0?en(f,c):Te(f,r)}(h,l,p),u*g}var jn=Math.ceil,Sn=0x40000000000000,Tn=1.4426950407214463,Un=1.6751713164886512e-10,In=2146435072,xn=1048576,On=1072693248,Nn=[0,0];function kn(r){var e,n;return Ar(r)||Er(r)||0===r?r:(r<0?(r=-r,e=-1):e=1,n=function(r){var e,n,t,i,o,a,u,f,c,s,l,p,y;if(Ar(r)||r<0)return NaN;if(Kr.assign(r,Nn,1,0),i=Nn[0],o=Nn[1],y=0,i=In?r+r:i===On&&0===o?0:(y+=(i>>20)-Ue|0,l=y+=(p=614244+(i&=tn)&xn|0)>>20|0,t=.5*(f=(r=Te(r,i|p^On))-1)*f,c=function(r){var e,n,t,i,o,a;return e=(o=(i=(t=r/(2+r))*t)*i)*(0===(a=o)?.3999999999940942:.3999999999940942+a*(.22222198432149784+.15313837699209373*a)),n=i*function(r){return 0===r?.6666666666666735:.6666666666666735+r*(.2857142874366239+r*(.1818357216161805+.14798198605116586*r))}(o),t*(.5*r*r+(n+e))}(f),n=((u=f-(a=ne(a=f-t,0))-t+c)+a)*Un+u*Tn,(n+=l-(s=l+(e=a*Tn))+e)+(e=s))}(r),n===Ze?r:(n=-1===e?f(n):jn(n))>Me?er:e*_n(2,n))}return function(r,e){if(!("object"==typeof(n=e)&&null!==n&&"number"==typeof n.length&&c(n.length)&&n.length>=0&&n.length<=s))throw new TypeError(sr("1Wn2y",e));var n;if(u(r))return function(r,e){var n;for(n=e.length-1;n>=0;n--)r.unshift(e[n]);return r}(r,e);if(function(r){return null!==r&&"object"==typeof r&&ur(r.length)&&r.length<=s&&"number"==typeof r.BYTES_PER_ELEMENT&&"number"==typeof r.byteOffset&&"number"==typeof r.byteLength}(r))return function(r,e){var n,t,i,o,a,u,f,c;if(o=r.length,t=(u=e.length)*r.BYTES_PER_ELEMENT,(i=r.byteOffset)=0)return function(r,e){var n,t,i;for(n=r.length,t=e.length,i=n-1;i>=0;i--)r[i+t]=r[i];for(i=0;i\n*/\nfunction hasToStringTagSupport() {\n\treturn ( FLG && typeof Symbol.toStringTag === 'symbol' );\n}\n\n\n// EXPORTS //\n\nexport default hasToStringTagSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests for native `Symbol` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol` support\n*\n* @example\n* var bool = hasSymbolSupport();\n* // returns \n*/\nfunction hasSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasSymbolSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar toStr = Object.prototype.toString;\n\n\n// EXPORTS //\n\nexport default toStr;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\nvar has = Object.prototype.hasOwnProperty;\n\n\n// MAIN //\n\n/**\n* Tests if an object has a specified property.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object has a specified property\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'bap' );\n* // returns false\n*/\nfunction hasOwnProp( value, property ) {\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\treturn has.call( value, property );\n}\n\n\n// EXPORTS //\n\nexport default hasOwnProp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar Sym = ( typeof Symbol === 'function' ) ? Symbol : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Sym;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Symbol from '@stdlib/symbol-ctor';\n\n\n// MAIN //\n\nvar toStrTag = ( typeof Symbol === 'function' ) ? Symbol.toStringTag : '';\n\n\n// EXPORTS //\n\nexport default toStrTag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a string value indicating a specification defined classification of an object.\n*\n* @module @stdlib/utils-native-class\n*\n* @example\n* import nativeClass from '@stdlib/utils-native-class';\n*\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* function Beep() {\n* return this;\n* }\n* str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main;\nif ( hasToStringTag() ) {\n\tmain = polyfill;\n} else {\n\tmain = builtin;\n}\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport toStringTag from './tostringtag.js';\nimport toStr from './tostring.js';\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification of an object in environments supporting `Symbol.toStringTag`.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\tvar isOwn;\n\tvar tag;\n\tvar out;\n\n\tif ( v === null || v === void 0 ) {\n\t\treturn toStr.call( v );\n\t}\n\ttag = v[ toStringTag ];\n\tisOwn = hasOwnProp( v, toStringTag );\n\n\t// Attempt to override the `toStringTag` property. For built-ins having a `Symbol.toStringTag` property (e.g., `JSON`, `Math`, etc), the `Symbol.toStringTag` property is read-only (e.g., , so we need to wrap in a `try/catch`.\n\ttry {\n\t\tv[ toStringTag ] = void 0;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn toStr.call( v );\n\t}\n\tout = toStr.call( v );\n\n\tif ( isOwn ) {\n\t\tv[ toStringTag ] = tag;\n\t} else {\n\t\tdelete v[ toStringTag ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default nativeClass;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toStr from './tostring.js';\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification (via the internal property `[[Class]]`) of an object.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\treturn toStr.call( v );\n}\n\n\n// EXPORTS //\n\nexport default nativeClass;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar f;\n\n\n// FUNCTIONS //\n\n/**\n* Tests if a value is an array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an array\n*\n* @example\n* var bool = isArray( [] );\n* // returns true\n*\n* @example\n* var bool = isArray( {} );\n* // returns false\n*/\nfunction isArray( value ) {\n\treturn ( nativeClass( value ) === '[object Array]' );\n}\n\n\n// MAIN //\n\nif ( Array.isArray ) {\n\tf = Array.isArray;\n} else {\n\tf = isArray;\n}\n\n\n// EXPORTS //\n\nexport default f;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward negative infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = floor( -4.2 );\n* // returns -5.0\n*\n* @example\n* var v = floor( 9.99999 );\n* // returns 9.0\n*\n* @example\n* var v = floor( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = floor( NaN );\n* // returns NaN\n*/\nvar floor = Math.floor; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default floor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport floor from '@stdlib/math-base-special-floor';\n\n\n// MAIN //\n\n/**\n* Tests if a finite double-precision floating-point number is an integer.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an integer\n*\n* @example\n* var bool = isInteger( 1.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( 3.14 );\n* // returns false\n*/\nfunction isInteger( x ) {\n\treturn (floor(x) === x);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum length of a typed array.\n*\n* @module @stdlib/constants-array-max-typed-array-length\n*\n* @example\n* import MAX_TYPED_ARRAY_LENGTH from '@stdlib/constants-array-max-typed-array-length';\n* // returns 9007199254740991\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a typed array.\n*\n* ```tex\n* 2^{53} - 1\n* ```\n*\n* @constant\n* @type {number}\n* @default 9007199254740991\n*/\nvar MAX_TYPED_ARRAY_LENGTH = 9007199254740991;\n\n\n// EXPORTS //\n\nexport default MAX_TYPED_ARRAY_LENGTH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Object.defineProperty === 'function' ) ? Object.defineProperty : null;\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @name defineProperty\n* @type {Function}\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nvar defineProperty = Object.defineProperty;\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( typeof value === 'number' ); // NOTE: we inline the `isNumber.isPrimitive` function from `@stdlib/assert/is-number` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Tests if a string starts with a minus sign (`-`).\n*\n* @private\n* @param {string} str - input string\n* @returns {boolean} boolean indicating if a string starts with a minus sign (`-`)\n*/\nfunction startsWithMinus( str ) {\n\treturn str[ 0 ] === '-';\n}\n\n/**\n* Returns a string of `n` zeros.\n*\n* @private\n* @param {number} n - number of zeros\n* @returns {string} string of zeros\n*/\nfunction zeros( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += '0';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with zeros to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction zeroPad( str, width, right ) {\n\tvar negative = false;\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tif ( startsWithMinus( str ) ) {\n\t\tnegative = true;\n\t\tstr = str.substr( 1 );\n\t}\n\tstr = ( right ) ?\n\t\tstr + zeros( pad ) :\n\t\tzeros( pad ) + str;\n\tif ( negative ) {\n\t\tstr = '-' + str;\n\t}\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default zeroPad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNumber from './is_number.js';\nimport zeroPad from './zero_pad.js';\n\n// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.\nvar lowercase = String.prototype.toLowerCase;\nvar uppercase = String.prototype.toUpperCase;\n\n\n// MAIN //\n\n/**\n* Formats a token object argument as an integer.\n*\n* @private\n* @param {Object} token - token object\n* @throws {Error} must provide a valid integer\n* @returns {string} formatted token argument\n*/\nfunction formatInteger( token ) {\n\tvar base;\n\tvar out;\n\tvar i;\n\n\tswitch ( token.specifier ) {\n\tcase 'b':\n\t\t// Case: %b (binary)\n\t\tbase = 2;\n\t\tbreak;\n\tcase 'o':\n\t\t// Case: %o (octal)\n\t\tbase = 8;\n\t\tbreak;\n\tcase 'x':\n\tcase 'X':\n\t\t// Case: %x, %X (hexadecimal)\n\t\tbase = 16;\n\t\tbreak;\n\tcase 'd':\n\tcase 'i':\n\tcase 'u':\n\tdefault:\n\t\t// Case: %d, %i, %u (decimal)\n\t\tbase = 10;\n\t\tbreak;\n\t}\n\tout = token.arg;\n\ti = parseInt( out, 10 );\n\tif ( !isFinite( i ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\tif ( !isNumber( out ) ) {\n\t\t\tthrow new Error( 'invalid integer. Value: ' + out );\n\t\t}\n\t\ti = 0;\n\t}\n\tif ( i < 0 && ( token.specifier === 'u' || base !== 10 ) ) {\n\t\ti = 0xffffffff + i + 1;\n\t}\n\tif ( i < 0 ) {\n\t\tout = ( -i ).toString( base );\n\t\tif ( token.precision ) {\n\t\t\tout = zeroPad( out, token.precision, token.padRight );\n\t\t}\n\t\tout = '-' + out;\n\t} else {\n\t\tout = i.toString( base );\n\t\tif ( !i && !token.precision ) {\n\t\t\tout = '';\n\t\t} else if ( token.precision ) {\n\t\t\tout = zeroPad( out, token.precision, token.padRight );\n\t\t}\n\t\tif ( token.sign ) {\n\t\t\tout = token.sign + out;\n\t\t}\n\t}\n\tif ( base === 16 ) {\n\t\tif ( token.alternate ) {\n\t\t\tout = '0x' + out;\n\t\t}\n\t\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\t\tuppercase.call( out ) :\n\t\t\tlowercase.call( out );\n\t}\n\tif ( base === 8 ) {\n\t\tif ( token.alternate && out.charAt( 0 ) !== '0' ) {\n\t\t\tout = '0' + out;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNumber from './is_number.js';\n\n// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.\nvar abs = Math.abs; // eslint-disable-line stdlib/no-builtin-math\nvar lowercase = String.prototype.toLowerCase;\nvar uppercase = String.prototype.toUpperCase;\nvar replace = String.prototype.replace;\n\n\n// VARIABLES //\n\nvar RE_EXP_POS_DIGITS = /e\\+(\\d)$/;\nvar RE_EXP_NEG_DIGITS = /e-(\\d)$/;\nvar RE_ONLY_DIGITS = /^(\\d+)$/;\nvar RE_DIGITS_BEFORE_EXP = /^(\\d+)e/;\nvar RE_TRAILING_PERIOD_ZERO = /\\.0$/;\nvar RE_PERIOD_ZERO_EXP = /\\.0*e/;\nvar RE_ZERO_BEFORE_EXP = /(\\..*[^0])0*e/;\n\n\n// MAIN //\n\n/**\n* Formats a token object argument as a floating-point number.\n*\n* @private\n* @param {Object} token - token object\n* @throws {Error} must provide a valid floating-point number\n* @returns {string} formatted token argument\n*/\nfunction formatDouble( token ) {\n\tvar digits;\n\tvar out;\n\tvar f = parseFloat( token.arg );\n\tif ( !isFinite( f ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\tif ( !isNumber( token.arg ) ) {\n\t\t\tthrow new Error( 'invalid floating-point number. Value: ' + out );\n\t\t}\n\t\t// Case: NaN, Infinity, or -Infinity\n\t\tf = token.arg;\n\t}\n\tswitch ( token.specifier ) {\n\tcase 'e':\n\tcase 'E':\n\t\tout = f.toExponential( token.precision );\n\t\tbreak;\n\tcase 'f':\n\tcase 'F':\n\t\tout = f.toFixed( token.precision );\n\t\tbreak;\n\tcase 'g':\n\tcase 'G':\n\t\tif ( abs( f ) < 0.0001 ) {\n\t\t\tdigits = token.precision;\n\t\t\tif ( digits > 0 ) {\n\t\t\t\tdigits -= 1;\n\t\t\t}\n\t\t\tout = f.toExponential( digits );\n\t\t} else {\n\t\t\tout = f.toPrecision( token.precision );\n\t\t}\n\t\tif ( !token.alternate ) {\n\t\t\tout = replace.call( out, RE_ZERO_BEFORE_EXP, '$1e' );\n\t\t\tout = replace.call( out, RE_PERIOD_ZERO_EXP, 'e' );\n\t\t\tout = replace.call( out, RE_TRAILING_PERIOD_ZERO, '' );\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tthrow new Error( 'invalid double notation. Value: ' + token.specifier );\n\t}\n\tout = replace.call( out, RE_EXP_POS_DIGITS, 'e+0$1' );\n\tout = replace.call( out, RE_EXP_NEG_DIGITS, 'e-0$1' );\n\tif ( token.alternate ) {\n\t\tout = replace.call( out, RE_ONLY_DIGITS, '$1.' );\n\t\tout = replace.call( out, RE_DIGITS_BEFORE_EXP, '$1.e' );\n\t}\n\tif ( f >= 0 && token.sign ) {\n\t\tout = token.sign + out;\n\t}\n\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\tuppercase.call( out ) :\n\t\tlowercase.call( out );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatDouble;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Returns `n` spaces.\n*\n* @private\n* @param {number} n - number of spaces\n* @returns {string} string of spaces\n*/\nfunction spaces( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += ' ';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with spaces to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction spacePad( str, width, right ) {\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tstr = ( right ) ?\n\t\tstr + spaces( pad ) :\n\t\tspaces( pad ) + str;\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default spacePad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport formatInteger from './format_integer.js';\nimport isString from './is_string.js';\nimport formatDouble from './format_double.js';\nimport spacePad from './space_pad.js';\nimport zeroPad from './zero_pad.js';\n\n\n// VARIABLES //\n\nvar fromCharCode = String.fromCharCode;\nvar isArray = Array.isArray; // NOTE: We use the global `Array.isArray` function here instead of `@stdlib/assert/is-array` to avoid circular dependencies.\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating whether a value is `NaN`.\n*\n* @private\n* @param {*} value - input value\n* @returns {boolean} boolean indicating whether a value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 4 );\n* // returns false\n*/\nfunction isnan( value ) { // explicitly define a function here instead of `@stdlib/math/base/assert/is-nan` in order to avoid circular dependencies\n\treturn ( value !== value );\n}\n\n/**\n* Initializes token object with properties of supplied format identifier object or default values if not present.\n*\n* @private\n* @param {Object} token - format identifier object\n* @returns {Object} token object\n*/\nfunction initialize( token ) {\n\tvar out = {};\n\tout.specifier = token.specifier;\n\tout.precision = ( token.precision === void 0 ) ? 1 : token.precision;\n\tout.width = token.width;\n\tout.flags = token.flags || '';\n\tout.mapping = token.mapping;\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates string from a token array by interpolating values.\n*\n* @param {Array} tokens - string parts and format identifier objects\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be an array\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var tokens = [ 'beep ', { 'specifier': 's' } ];\n* var out = formatInterpolate( tokens, 'boop' );\n* // returns 'beep boop'\n*/\nfunction formatInterpolate( tokens ) {\n\tvar hasPeriod;\n\tvar flags;\n\tvar token;\n\tvar flag;\n\tvar num;\n\tvar out;\n\tvar pos;\n\tvar i;\n\tvar j;\n\n\tif ( !isArray( tokens ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be an array. Value: `' + tokens + '`.' );\n\t}\n\tout = '';\n\tpos = 1;\n\tfor ( i = 0; i < tokens.length; i++ ) {\n\t\ttoken = tokens[ i ];\n\t\tif ( isString( token ) ) {\n\t\t\tout += token;\n\t\t} else {\n\t\t\thasPeriod = token.precision !== void 0;\n\t\t\ttoken = initialize( token );\n\t\t\tif ( !token.specifier ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. Token is missing `specifier` property. Index: `'+ i +'`. Value: `' + token + '`.' );\n\t\t\t}\n\t\t\tif ( token.mapping ) {\n\t\t\t\tpos = token.mapping;\n\t\t\t}\n\t\t\tflags = token.flags;\n\t\t\tfor ( j = 0; j < flags.length; j++ ) {\n\t\t\t\tflag = flags.charAt( j );\n\t\t\t\tswitch ( flag ) {\n\t\t\t\tcase ' ':\n\t\t\t\t\ttoken.sign = ' ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+':\n\t\t\t\t\ttoken.sign = '+';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '0':\n\t\t\t\t\ttoken.padZeros = flags.indexOf( '-' ) < 0; // NOTE: We use built-in `Array.prototype.indexOf` here instead of `@stdlib/assert/contains` in order to avoid circular dependencies.\n\t\t\t\t\tbreak;\n\t\t\t\tcase '#':\n\t\t\t\t\ttoken.alternate = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'invalid flag: ' + flag );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( token.width === '*' ) {\n\t\t\t\ttoken.width = parseInt( arguments[ pos ], 10 );\n\t\t\t\tpos += 1;\n\t\t\t\tif ( isnan( token.width ) ) {\n\t\t\t\t\tthrow new TypeError( 'the argument for * width at position ' + pos + ' is not a number. Value: `' + token.width + '`.' );\n\t\t\t\t}\n\t\t\t\tif ( token.width < 0 ) {\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.width = -token.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( hasPeriod ) {\n\t\t\t\tif ( token.precision === '*' ) {\n\t\t\t\t\ttoken.precision = parseInt( arguments[ pos ], 10 );\n\t\t\t\t\tpos += 1;\n\t\t\t\t\tif ( isnan( token.precision ) ) {\n\t\t\t\t\t\tthrow new TypeError( 'the argument for * precision at position ' + pos + ' is not a number. Value: `' + token.precision + '`.' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( token.precision < 0 ) {\n\t\t\t\t\t\ttoken.precision = 1;\n\t\t\t\t\t\thasPeriod = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoken.arg = arguments[ pos ];\n\t\t\tswitch ( token.specifier ) {\n\t\t\tcase 'b':\n\t\t\tcase 'o':\n\t\t\tcase 'x':\n\t\t\tcase 'X':\n\t\t\tcase 'd':\n\t\t\tcase 'i':\n\t\t\tcase 'u':\n\t\t\t\t// Case: %b (binary), %o (octal), %x, %X (hexadecimal), %d, %i (decimal), %u (unsigned decimal)\n\t\t\t\tif ( hasPeriod ) {\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatInteger( token );\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t// Case: %s (string)\n\t\t\t\ttoken.maxWidth = ( hasPeriod ) ? token.precision : -1;\n\t\t\t\ttoken.arg = String( token.arg );\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t// Case: %c (character)\n\t\t\t\tif ( !isnan( token.arg ) ) {\n\t\t\t\t\tnum = parseInt( token.arg, 10 );\n\t\t\t\t\tif ( num < 0 || num > 127 ) {\n\t\t\t\t\t\tthrow new Error( 'invalid character code. Value: ' + token.arg );\n\t\t\t\t\t}\n\t\t\t\t\ttoken.arg = ( isnan( num ) ) ? String( token.arg ) : fromCharCode( num ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\tcase 'g':\n\t\t\tcase 'G':\n\t\t\t\t// Case: %e, %E (scientific notation), %f, %F (decimal floating point), %g, %G (uses the shorter of %e/E or %f/F)\n\t\t\t\tif ( !hasPeriod ) {\n\t\t\t\t\ttoken.precision = 6;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatDouble( token );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'invalid specifier: ' + token.specifier );\n\t\t\t}\n\t\t\t// Fit argument into field width...\n\t\t\tif ( token.maxWidth >= 0 && token.arg.length > token.maxWidth ) {\n\t\t\t\ttoken.arg = token.arg.substring( 0, token.maxWidth );\n\t\t\t}\n\t\t\tif ( token.padZeros ) {\n\t\t\t\ttoken.arg = zeroPad( token.arg, token.width || token.precision, token.padRight ); // eslint-disable-line max-len\n\t\t\t} else if ( token.width ) {\n\t\t\t\ttoken.arg = spacePad( token.arg, token.width, token.padRight );\n\t\t\t}\n\t\t\tout += token.arg || '';\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInterpolate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar RE = /%(?:([1-9]\\d*)\\$)?([0 +\\-#]*)(\\*|\\d+)?(?:(\\.)(\\*|\\d+)?)?[hlL]?([%A-Za-z])/g;\n\n\n// FUNCTIONS //\n\n/**\n* Parses a delimiter.\n*\n* @private\n* @param {Array} match - regular expression match\n* @returns {Object} delimiter token object\n*/\nfunction parse( match ) {\n\tvar token = {\n\t\t'mapping': ( match[ 1 ] ) ? parseInt( match[ 1 ], 10 ) : void 0,\n\t\t'flags': match[ 2 ],\n\t\t'width': match[ 3 ],\n\t\t'precision': match[ 5 ],\n\t\t'specifier': match[ 6 ]\n\t};\n\tif ( match[ 4 ] === '.' && match[ 5 ] === void 0 ) {\n\t\ttoken.precision = '1';\n\t}\n\treturn token;\n}\n\n\n// MAIN //\n\n/**\n* Tokenizes a string into an array of string parts and format identifier objects.\n*\n* @param {string} str - input string\n* @returns {Array} tokens\n*\n* @example\n* var tokens = formatTokenize( 'Hello %s!' );\n* // returns [ 'Hello ', {...}, '!' ]\n*/\nfunction formatTokenize( str ) {\n\tvar content;\n\tvar tokens;\n\tvar match;\n\tvar prev;\n\n\ttokens = [];\n\tprev = 0;\n\tmatch = RE.exec( str );\n\twhile ( match ) {\n\t\tcontent = str.slice( prev, RE.lastIndex - match[ 0 ].length );\n\t\tif ( content.length ) {\n\t\t\ttokens.push( content );\n\t\t}\n\t\ttokens.push( parse( match ) );\n\t\tprev = RE.lastIndex;\n\t\tmatch = RE.exec( str );\n\t}\n\tcontent = str.slice( prev );\n\tif ( content.length ) {\n\t\ttokens.push( content );\n\t}\n\treturn tokens;\n}\n\n\n// EXPORTS //\n\nexport default formatTokenize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport interpolate from '@stdlib/string-base-format-interpolate';\nimport tokenize from '@stdlib/string-base-format-tokenize';\nimport isString from './is_string.js';\n\n\n// MAIN //\n\n/**\n* Inserts supplied variable values into a format string.\n*\n* @param {string} str - input string\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be a string\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var str = format( 'Hello %s!', 'world' );\n* // returns 'Hello world!'\n*\n* @example\n* var str = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\nfunction format( str ) {\n\tvar args;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\targs = [ tokenize( str ) ];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn interpolate.apply( null, args );\n}\n\n\n// EXPORTS //\n\nexport default format;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, no-proto */\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar objectProtoype = Object.prototype;\nvar toStr = objectProtoype.toString;\nvar defineGetter = objectProtoype.__defineGetter__;\nvar defineSetter = objectProtoype.__defineSetter__;\nvar lookupGetter = objectProtoype.__lookupGetter__;\nvar lookupSetter = objectProtoype.__lookupSetter__;\n\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @param {Object} obj - object on which to define the property\n* @param {string} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nfunction defineProperty( obj, prop, descriptor ) {\n\tvar prototype;\n\tvar hasValue;\n\tvar hasGet;\n\tvar hasSet;\n\n\tif ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', descriptor ) );\n\t}\n\thasValue = ( 'value' in descriptor );\n\tif ( hasValue ) {\n\t\tif (\n\t\t\tlookupGetter.call( obj, prop ) ||\n\t\t\tlookupSetter.call( obj, prop )\n\t\t) {\n\t\t\t// Override `__proto__` to avoid touching inherited accessors:\n\t\t\tprototype = obj.__proto__;\n\t\t\tobj.__proto__ = objectProtoype;\n\n\t\t\t// Delete property as existing getters/setters prevent assigning value to specified property:\n\t\t\tdelete obj[ prop ];\n\t\t\tobj[ prop ] = descriptor.value;\n\n\t\t\t// Restore original prototype:\n\t\t\tobj.__proto__ = prototype;\n\t\t} else {\n\t\t\tobj[ prop ] = descriptor.value;\n\t\t}\n\t}\n\thasGet = ( 'get' in descriptor );\n\thasSet = ( 'set' in descriptor );\n\n\tif ( hasValue && ( hasGet || hasSet ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );\n\t}\n\n\tif ( hasGet && defineGetter ) {\n\t\tdefineGetter.call( obj, prop, descriptor.get );\n\t}\n\tif ( hasSet && defineSetter ) {\n\t\tdefineSetter.call( obj, prop, descriptor.set );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define (or modify) an object property.\n*\n* @module @stdlib/utils-define-property\n*\n* @example\n* import defineProperty from '@stdlib/utils-define-property';\n*\n* var obj = {};\n* defineProperty( obj, 'foo', {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': false\n* });\n* obj.foo = 'boop'; // => throws\n*/\n\n// MODULES //\n\nimport hasDefinePropertySupport from './has_define_property_support.js';\nimport builtin from './builtin.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar defineProperty;\nif ( hasDefinePropertySupport() ) {\n\tdefineProperty = builtin;\n} else {\n\tdefineProperty = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from './define_property.js';\n\n\n// MAIN //\n\n/**\n* Tests for `Object.defineProperty` support.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support\n*\n* @example\n* var bool = hasDefinePropertySupport();\n* // returns \n*/\nfunction hasDefinePropertySupport() {\n\t// Test basic support...\n\ttry {\n\t\tdefineProperty( {}, 'x', {} );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default hasDefinePropertySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( typeof value === 'number' );\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// EXPORTS //\n\nexport default Number; // eslint-disable-line stdlib/require-globals\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar toString = Number.prototype.toString; // non-generic\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport nativeClass from '@stdlib/utils-native-class';\nimport Number from '@stdlib/number-ctor';\nimport test from './try2serialize.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\nfunction isNumber( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof Number ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object Number]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toString from './tostring.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to serialize a value to a string.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value can be serialized\n*/\nfunction test( value ) {\n\ttry {\n\t\ttoString.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a number\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( null );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a number.\n*\n* @module @stdlib/assert-is-number\n*\n* @example\n* import isNumber from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNumber } from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNumber } from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* @module @stdlib/constants-float64-pinf\n* @type {number}\n*\n* @example\n* import FLOAT64_PINF from '@stdlib/constants-float64-pinf';\n* // returns Infinity\n*/\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point positive infinity has the bit sequence\n*\n* ```binarystring\n* 0 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.POSITIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_PINF = Number.POSITIVE_INFINITY; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default FLOAT64_PINF;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* @module @stdlib/constants-float64-ninf\n* @type {number}\n*\n* @example\n* import FLOAT64_NINF from '@stdlib/constants-float64-ninf';\n* // returns -Infinity\n*/\n\n// MODULES //\n\nimport Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point negative infinity has the bit sequence\n*\n* ```binarystring\n* 1 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.NEGATIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_NINF = Number.NEGATIVE_INFINITY;\n\n\n// EXPORTS //\n\nexport default FLOAT64_NINF;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport PINF from '@stdlib/constants-float64-pinf';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport isInt from '@stdlib/math-base-assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a number primitive is an integer value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a number primitive is an integer value\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tvalue < PINF &&\n\t\tvalue > NINF &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having an integer value\n*\n* @example\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isNumber } from '@stdlib/assert-is-number';\nimport isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having an integer value\n*\n* @example\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an integer\n*\n* @example\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isInteger( -3.14 );\n* // returns false\n*\n* @example\n* var bool = isInteger( null );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a nonnegative integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a nonnegative integer\n*\n* @example\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( null );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Formats an error message for production.\n*\n* @param {string} code - error code\n* @param {*} ...args - error message arguments\n* @returns {string} formatted error message\n*\n* @example\n* var msg = fmtprodmsg( '3', 'wrong_type' );\n* // returns 'https://stdlib.io/e/3?&arg[]=wrong_type'\n*/\nfunction fmtprodmsg() {\n\tvar a = arguments;\n\tvar c = a[ 0 ];\n\tvar u = 'https://stdlib.io/e/'+c+'?';\n\tvar i;\n\tfor ( i = 1; i < a.length; i++ ) {\n\t\tu += '&arg[]=' + encodeURIComponent( a[ i ] );\n\t}\n\treturn u;\n}\n\n\n// EXPORTS //\n\nexport default fmtprodmsg;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an integer.\n*\n* @module @stdlib/assert-is-integer\n*\n* @example\n* import isInteger from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isInteger( -3.14 );\n* // returns false\n*\n* bool = isInteger( null );\n* // returns false\n*\n* @example\n* // Use interface to check for integer primitives...\n* import { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*\n* @example\n* // Use interface to check for integer objects...\n* import { isObject as isInteger } from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a nonnegative integer.\n*\n* @module @stdlib/assert-is-nonnegative-integer\n*\n* @example\n* import isNonNegativeInteger from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* bool = isNonNegativeInteger( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasArrayBuffer = ( typeof ArrayBuffer === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an ArrayBuffer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an ArrayBuffer\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var bool = isArrayBuffer( new ArrayBuffer( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isArrayBuffer( [] );\n* // returns false\n*/\nfunction isArrayBuffer( value ) {\n\treturn (\n\t\t( hasArrayBuffer && value instanceof ArrayBuffer ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object ArrayBuffer]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array-float64\n*\n* @example\n* import ctor from '@stdlib/array-float64';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFloat64ArraySupport from '@stdlib/assert-has-float64array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat64ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasFloat64Array = ( typeof Float64Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float64Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float64Array\n*\n* @example\n* var bool = isFloat64Array( new Float64Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat64Array( [] );\n* // returns false\n*/\nfunction isFloat64Array( value ) {\n\treturn (\n\t\t( hasFloat64Array && value instanceof Float64Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float64Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isFloat64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Float64Array === 'function' ) ? Float64Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Float64Array === 'function' ) ? Float64Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFloat64Array from '@stdlib/assert-is-float64array';\nimport GlobalFloat64Array from './float64array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Float64Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float64Array` support\n*\n* @example\n* var bool = hasFloat64ArraySupport();\n* // returns \n*/\nfunction hasFloat64ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat64Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat64Array( [ 1.0, 3.14, -3.14, NaN ] );\n\t\tbool = (\n\t\t\tisFloat64Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.14 &&\n\t\t\tarr[ 2 ] === -3.14 &&\n\t\t\tarr[ 3 ] !== arr[ 3 ]\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasFloat64ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of double-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor which returns an object used to represent a generic, fixed-length raw binary data buffer.\n*\n* @module @stdlib/array-buffer\n*\n* @example\n* import ctor from '@stdlib/array-buffer';\n*\n* var buf = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasArrayBufferSupport from '@stdlib/assert-has-arraybuffer-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasArrayBufferSupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof ArrayBuffer === 'function' ) ? ArrayBuffer : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof ArrayBuffer === 'function' ) ? ArrayBuffer : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport Float64Array from '@stdlib/array-float64';\nimport GlobalArrayBuffer from './arraybuffer.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `ArrayBuffer` support.\n*\n* @returns {boolean} boolean indicating if an environment has `ArrayBuffer` support\n*\n* @example\n* var bool = hasArrayBufferSupport();\n* // returns \n*/\nfunction hasArrayBufferSupport() {\n\tvar bool;\n\tvar view;\n\tvar buf;\n\n\tif ( typeof GlobalArrayBuffer !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tbuf = new GlobalArrayBuffer( 16 );\n\t\tbool = ( isArrayBuffer( buf ) && typeof GlobalArrayBuffer.isView === 'function' );\n\t\tif ( bool ) {\n\t\t\tview = new Float64Array( buf );\n\t\t\tview[ 0 ] = -3.14;\n\t\t\tview[ 1 ] = NaN;\n\t\t\tbool = (\n\t\t\t\tbool &&\n\t\t\t\tGlobalArrayBuffer.isView( view ) &&\n\t\t\t\tbuf.byteLength === 16 &&\n\t\t\t\tview[ 0 ] === -3.14 &&\n\t\t\t\tview[ 1 ] !== view[ 1 ]\n\t\t\t);\n\t\t}\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasArrayBufferSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Constructor which returns an object used to represent a generic, fixed-length raw binary data buffer.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is `NaN`.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 7.0 );\n* // returns false\n*/\nfunction isnan( x ) {\n\treturn ( x !== x );\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport PINF from '@stdlib/constants-float64-pinf';\nimport NINF from '@stdlib/constants-float64-ninf';\n\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is infinite.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is infinite\n*\n* @example\n* var bool = isInfinite( Infinity );\n* // returns true\n*\n* @example\n* var bool = isInfinite( -Infinity );\n* // returns true\n*\n* @example\n* var bool = isInfinite( 5.0 );\n* // returns false\n*\n* @example\n* var bool = isInfinite( NaN );\n* // returns false\n*/\nfunction isInfinite( x ) {\n\treturn (x === PINF || x === NINF);\n}\n\n\n// EXPORTS //\n\nexport default isInfinite;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math-base-assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a finite numeric value is an even number.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an even number\n*\n* @example\n* var bool = isEven( 5.0 );\n* // returns false\n*\n* @example\n* var bool = isEven( -2.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( 0.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( NaN );\n* // returns false\n*/\nfunction isEven( x ) {\n\treturn isInteger( x/2.0 );\n}\n\n\n// EXPORTS //\n\nexport default isEven;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isEven from '@stdlib/math-base-assert-is-even';\n\n\n// MAIN //\n\n/**\n* Tests if a finite double-precision floating-point number is an odd number.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an odd number\n*\n* @example\n* var bool = isOdd( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isOdd( -2.0 );\n* // returns false\n*\n* @example\n* var bool = isOdd( 0.0 );\n* // returns false\n*\n* @example\n* var bool = isOdd( NaN );\n* // returns false\n*/\nfunction isOdd( x ) {\n\t// Check sign to prevent overflow...\n\tif ( x > 0.0 ) {\n\t\treturn isEven( x-1.0 );\n\t}\n\treturn isEven( x+1.0 );\n}\n\n\n// EXPORTS //\n\nexport default isOdd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Compute the principal square root of a double-precision floating-point number.\n*\n* @type {Function}\n* @param {number} x - input value\n* @returns {number} principal square root\n*\n* @example\n* var v = sqrt( 4.0 );\n* // returns 2.0\n*\n* v = sqrt( 9.0 );\n* // returns 3.0\n*\n* v = sqrt( 0.0 );\n* // returns 0.0\n*\n* v = sqrt( -4.0 );\n* // returns NaN\n*\n* v = sqrt( NaN );\n* // returns NaN\n*/\nvar sqrt = Math.sqrt; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default sqrt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the absolute value of a double-precision floating-point number `x`.\n*\n* @param {number} x - input value\n* @returns {number} absolute value\n*\n* @example\n* var v = abs( -1.0 );\n* // returns 1.0\n*\n* @example\n* var v = abs( 2.0 );\n* // returns 2.0\n*\n* @example\n* var v = abs( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( -0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( NaN );\n* // returns NaN\n*/\nfunction abs( x ) {\n\treturn Math.abs( x ); // eslint-disable-line stdlib/no-builtin-math\n}\n\n\n// EXPORTS //\n\nexport default abs;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint32Array = ( typeof Uint32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint32Array\n*\n* @example\n* var bool = isUint32Array( new Uint32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint32Array( [] );\n* // returns false\n*/\nfunction isUint32Array( value ) {\n\treturn (\n\t\t( hasUint32Array && value instanceof Uint32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint32\n*\n* @example\n* import ctor from '@stdlib/array-uint32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint32ArraySupport from '@stdlib/assert-has-uint32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint32Array === 'function' ) ? Uint32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint32Array === 'function' ) ? Uint32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint32Array from '@stdlib/assert-is-uint32array';\nimport UINT32_MAX from '@stdlib/constants-uint32-max';\nimport GlobalUint32Array from './uint32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint32Array` support\n*\n* @example\n* var bool = hasUint32ArraySupport();\n* // returns \n*/\nfunction hasUint32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT32_MAX+1, UINT32_MAX+2 ];\n\t\tarr = new GlobalUint32Array( arr );\n\t\tbool = (\n\t\t\tisUint32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT32_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 32-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint8\n*\n* @example\n* import ctor from '@stdlib/array-uint8';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint8ArraySupport from '@stdlib/assert-has-uint8array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint8Array = ( typeof Uint8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8Array\n*\n* @example\n* var bool = isUint8Array( new Uint8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8Array( [] );\n* // returns false\n*/\nfunction isUint8Array( value ) {\n\treturn (\n\t\t( hasUint8Array && value instanceof Uint8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint8Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint8Array === 'function' ) ? Uint8Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint8Array === 'function' ) ? Uint8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint8Array from '@stdlib/assert-is-uint8array';\nimport UINT8_MAX from '@stdlib/constants-uint8-max';\nimport GlobalUint8Array from './uint8array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8Array` support\n*\n* @example\n* var bool = hasUint8ArraySupport();\n* // returns \n*/\nfunction hasUint8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT8_MAX+1, UINT8_MAX+2 ];\n\t\tarr = new GlobalUint8Array( arr );\n\t\tbool = (\n\t\t\tisUint8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT8_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint8ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint16\n*\n* @example\n* import ctor from '@stdlib/array-uint16';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint16ArraySupport from '@stdlib/assert-has-uint16array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint16Array = ( typeof Uint16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint16Array\n*\n* @example\n* var bool = isUint16Array( new Uint16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint16Array( [] );\n* // returns false\n*/\nfunction isUint16Array( value ) {\n\treturn (\n\t\t( hasUint16Array && value instanceof Uint16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint16Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint16Array === 'function' ) ? Uint16Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint16Array === 'function' ) ? Uint16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint16Array from '@stdlib/assert-is-uint16array';\nimport UINT16_MAX from '@stdlib/constants-uint16-max';\nimport GlobalUint16Array from './uint16array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint16Array` support\n*\n* @example\n* var bool = hasUint16ArraySupport();\n* // returns \n*/\nfunction hasUint16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT16_MAX+1, UINT16_MAX+2 ];\n\t\tarr = new GlobalUint16Array( arr );\n\t\tbool = (\n\t\t\tisUint16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT16_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint16ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 16-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctors from './ctors.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an environment is little endian.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment is little endian\n*\n* @example\n* var bool = isLittleEndian();\n* // returns \n*/\nfunction isLittleEndian() {\n\tvar uint16view;\n\tvar uint8view;\n\n\tuint16view = new ctors[ 'uint16' ]( 1 );\n\n\t/*\n\t* Set the uint16 view to a value having distinguishable lower and higher order words.\n\t*\n\t* 4660 => 0x1234 => 0x12 0x34 => '00010010 00110100' => (0x12,0x34) == (18,52)\n\t*/\n\tuint16view[ 0 ] = 0x1234;\n\n\t// Create a uint8 view on top of the uint16 buffer:\n\tuint8view = new ctors[ 'uint8' ]( uint16view.buffer );\n\n\t// If little endian, the least significant byte will be first...\n\treturn ( uint8view[ 0 ] === 0x34 );\n}\n\n\n// MAIN //\n\nbool = isLittleEndian();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint16Array from '@stdlib/array-uint16';\n\n\n// MAIN //\n\nvar ctors = {\n\t'uint16': Uint16Array,\n\t'uint8': Uint8Array\n};\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isLittleEndian from '@stdlib/assert-is-little-endian';\n\n\n// MAIN //\n\nvar indices;\nvar HIGH;\nvar LOW;\n\nif ( isLittleEndian === true ) {\n\tHIGH = 1; // second index\n\tLOW = 0; // first index\n} else {\n\tHIGH = 0; // first index\n\tLOW = 1; // second index\n}\nindices = {\n\t'HIGH': HIGH,\n\t'LOW': LOW\n};\n\n\n// EXPORTS //\n\nexport default indices;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float64Array from '@stdlib/array-float64';\nimport indices from './indices.js';\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\nvar HIGH = indices.HIGH;\nvar LOW = indices.LOW;\n\n\n// MAIN //\n\n/**\n* Splits a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @private\n* @param {number} x - input value\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var out = new Uint32Array( 2 );\n*\n* var w = toWords( 3.14e201, out, 1, 0 );\n* // returns [ 1774486211, 2479577218 ]\n*\n* var bool = ( w === out );\n* // returns true\n*/\nfunction toWords( x, out, stride, offset ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\tout[ offset ] = UINT32_VIEW[ HIGH ];\n\tout[ offset + stride ] = UINT32_VIEW[ LOW ];\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toWords;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport fcn from './assign.js';\n\n\n// MAIN //\n\n/**\n* Splits a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* @param {number} x - input value\n* @returns {Array} output array\n*\n* @example\n* var w = toWords( 3.14e201 );\n* // returns [ 1774486211, 2479577218 ]\n*/\nfunction toWords( x ) {\n\treturn fcn( x, [ 0>>>0, 0>>>0 ], 1, 0 );\n}\n\n\n// EXPORTS //\n\nexport default toWords;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* @module @stdlib/number-float64-base-to-words\n*\n* @example\n* import toWords from '@stdlib/number-float64-base-to-words';\n*\n* var w = toWords( 3.14e201 );\n* // returns [ 1774486211, 2479577218 ]\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n* import toWords from '@stdlib/number-float64-base-to-words';\n*\n* var out = new Uint32Array( 2 );\n*\n* var w = toWords.assign( 3.14e201, out, 1, 0 );\n* // returns [ 1774486211, 2479577218 ]\n*\n* var bool = ( w === out );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isLittleEndian from '@stdlib/assert-is-little-endian';\n\n\n// MAIN //\n\nvar LOW;\nif ( isLittleEndian === true ) {\n\tLOW = 0; // first index\n} else {\n\tLOW = 1; // second index\n}\n\n\n// EXPORTS //\n\nexport default LOW;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float64Array from '@stdlib/array-float64';\nimport LOW from './low.js';\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\n\n// MAIN //\n\n/**\n* Sets the less significant 32 bits of a double-precision floating-point number.\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the lower order bits? If little endian, the first; if big endian, the second.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {number} x - double\n* @param {uinteger32} low - unsigned 32-bit integer to replace the lower order word of `x`\n* @returns {number} double having the same higher order word as `x`\n*\n* @example\n* var low = 5 >>> 0; // => 00000000000000000000000000000101\n*\n* var x = 3.14e201; // => 0 11010011100 01001000001011000011 10010011110010110101100010000010\n*\n* var y = setLowWord( x, low ); // => 0 11010011100 01001000001011000011 00000000000000000000000000000101\n* // returns 3.139998651394392e+201\n*\n* @example\n* import PINF from '@stdlib/constants-float64-pinf';\n* import NINF from '@stdlib/constants-float64-ninf';\n*\n* var low = 12345678;\n*\n* var y = setLowWord( PINF, low );\n* // returns NaN\n*\n* y = setLowWord( NINF, low );\n* // returns NaN\n*\n* y = setLowWord( NaN, low );\n* // returns NaN\n*/\nfunction setLowWord( x, low ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\tUINT32_VIEW[ LOW ] = ( low >>> 0 ); // identity bit shift to ensure integer\n\treturn FLOAT64_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nexport default setLowWord;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Converts an unsigned 32-bit integer to a signed 32-bit integer.\n*\n* @param {uinteger32} x - unsigned 32-bit integer\n* @returns {integer32} signed 32-bit integer\n*\n* @example\n* import float64ToUint32 from '@stdlib/number-float64-base-to-uint32';\n* var y = uint32ToInt32( float64ToUint32( 4294967295 ) );\n* // returns -1\n*\n* @example\n* import float64ToUint32 from '@stdlib/number-float64-base-to-uint32';\n* var y = uint32ToInt32( float64ToUint32( 3 ) );\n* // returns 3\n*/\nfunction uint32ToInt32( x ) {\n\t// NOTE: we could also use typed-arrays to achieve the same end.\n\treturn x|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nexport default uint32ToInt32;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* High word mask for excluding the sign bit of a double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-high-word-abs-mask\n* @type {uinteger32}\n*\n* @example\n* import FLOAT64_HIGH_WORD_ABS_MASK from '@stdlib/constants-float64-high-word-abs-mask';\n* // returns 2147483647\n*/\n\n\n// MAIN //\n\n/**\n* High word mask for excluding the sign bit of a double-precision floating-point number.\n*\n* ## Notes\n*\n* The high word mask for excluding the sign bit of a double-precision floating-point number is an unsigned 32-bit integer with the value \\\\( 2147483647 \\\\), which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 11111111111 11111111111111111111\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 0x7fffffff\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_HIGH_WORD_ABS_MASK = 0x7fffffff>>>0; // eslint-disable-line id-length\n\n\n// EXPORTS //\n\nexport default FLOAT64_HIGH_WORD_ABS_MASK;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isLittleEndian from '@stdlib/assert-is-little-endian';\n\n\n// MAIN //\n\nvar indices;\nvar HIGH;\nvar LOW;\n\nif ( isLittleEndian === true ) {\n\tHIGH = 1; // second index\n\tLOW = 0; // first index\n} else {\n\tHIGH = 0; // first index\n\tLOW = 1; // second index\n}\nindices = {\n\t'HIGH': HIGH,\n\t'LOW': LOW\n};\n\n\n// EXPORTS //\n\nexport default indices;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* High word mask for the sign bit of a double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-high-word-sign-mask\n* @type {uinteger32}\n*\n* @example\n* import FLOAT64_HIGH_WORD_SIGN_MASK from '@stdlib/constants-float64-high-word-sign-mask';\n* // returns 2147483648\n*/\n\n\n// MAIN //\n\n/**\n* High word mask for the sign bit of a double-precision floating-point number.\n*\n* ## Notes\n*\n* The high word mask for the sign bit of a double-precision floating-point number is an unsigned 32-bit integer with the value \\\\( 2147483648 \\\\), which corresponds to the bit sequence\n*\n* ```binarystring\n* 1 00000000000 00000000000000000000\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 0x80000000\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_HIGH_WORD_SIGN_MASK = 0x80000000>>>0; // eslint-disable-line id-length\n\n\n// EXPORTS //\n\nexport default FLOAT64_HIGH_WORD_SIGN_MASK;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isLittleEndian from '@stdlib/assert-is-little-endian';\n\n\n// MAIN //\n\nvar HIGH;\nif ( isLittleEndian === true ) {\n\tHIGH = 1; // second index\n} else {\n\tHIGH = 0; // first index\n}\n\n\n// EXPORTS //\n\nexport default HIGH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float64Array from '@stdlib/array-float64';\nimport HIGH from './high.js';\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\n\n// MAIN //\n\n/**\n* Returns an unsigned 32-bit integer corresponding to the more significant 32 bits of a double-precision floating-point number.\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {number} x - input value\n* @returns {uinteger32} higher order word\n*\n* @example\n* var w = getHighWord( 3.14e201 ); // => 01101001110001001000001011000011\n* // returns 1774486211\n*/\nfunction getHighWord( x ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\treturn UINT32_VIEW[ HIGH ];\n}\n\n\n// EXPORTS //\n\nexport default getHighWord;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float64Array from '@stdlib/array-float64';\nimport indices from './indices.js';\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\nvar HIGH = indices.HIGH;\nvar LOW = indices.LOW;\n\n\n// MAIN //\n\n/**\n* Creates a double-precision floating-point number from a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 should we place the higher order bits? If little endian, the second; if big endian, the first.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {uinteger32} high - higher order word (unsigned 32-bit integer)\n* @param {uinteger32} low - lower order word (unsigned 32-bit integer)\n* @returns {number} floating-point number\n*\n* @example\n* var v = fromWords( 1774486211, 2479577218 );\n* // returns 3.14e201\n*\n* @example\n* var v = fromWords( 3221823995, 1413754136 );\n* // returns -3.141592653589793\n*\n* @example\n* var v = fromWords( 0, 0 );\n* // returns 0.0\n*\n* @example\n* var v = fromWords( 2147483648, 0 );\n* // returns -0.0\n*\n* @example\n* var v = fromWords( 2146959360, 0 );\n* // returns NaN\n*\n* @example\n* var v = fromWords( 2146435072, 0 );\n* // returns Infinity\n*\n* @example\n* var v = fromWords( 4293918720, 0 );\n* // returns -Infinity\n*/\nfunction fromWords( high, low ) {\n\tUINT32_VIEW[ HIGH ] = high;\n\tUINT32_VIEW[ LOW ] = low;\n\treturn FLOAT64_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nexport default fromWords;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport SIGN_MASK from '@stdlib/constants-float64-high-word-sign-mask';\nimport ABS_MASK from '@stdlib/constants-float64-high-word-abs-mask';\nimport toWords from '@stdlib/number-float64-base-to-words';\nimport getHighWord from '@stdlib/number-float64-base-get-high-word';\nimport fromWords from '@stdlib/number-float64-base-from-words';\n\n\n// VARIABLES //\n\n// High/low words workspace:\nvar WORDS = [ 0, 0 ];\n\n\n// MAIN //\n\n/**\n* Returns a double-precision floating-point number with the magnitude of `x` and the sign of `y`.\n*\n* @param {number} x - number from which to derive a magnitude\n* @param {number} y - number from which to derive a sign\n* @returns {number} a double-precision floating-point number\n*\n* @example\n* var z = copysign( -3.14, 10.0 );\n* // returns 3.14\n*\n* @example\n* var z = copysign( 3.14, -1.0 );\n* // returns -3.14\n*\n* @example\n* var z = copysign( 1.0, -0.0 );\n* // returns -1.0\n*\n* @example\n* var z = copysign( -3.14, -0.0 );\n* // returns -3.14\n*\n* @example\n* var z = copysign( -0.0, 1.0 );\n* // returns 0.0\n*/\nfunction copysign( x, y ) {\n\tvar hx;\n\tvar hy;\n\n\t// Split `x` into higher and lower order words:\n\ttoWords.assign( x, WORDS, 1, 0 );\n\thx = WORDS[ 0 ];\n\n\t// Turn off the sign bit of `x`:\n\thx &= ABS_MASK;\n\n\t// Extract the higher order word from `y`:\n\thy = getHighWord( y );\n\n\t// Leave only the sign bit of `y` turned on:\n\thy &= SIGN_MASK;\n\n\t// Copy the sign bit of `y` to `x`:\n\thx |= hy;\n\n\t// Return a new value having the same magnitude as `x`, but with the sign of `y`:\n\treturn fromWords( hx, WORDS[ 1 ] );\n}\n\n\n// EXPORTS //\n\nexport default copysign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ABS_MASK from '@stdlib/constants-float64-high-word-abs-mask';\nimport getHighWord from '@stdlib/number-float64-base-get-high-word';\n\n\n// VARIABLES //\n\n// 0x3fefffff = 1072693247 => 0 01111111110 11111111111111111111 => biased exponent: 1022 = -1+1023 => 2^-1\nvar HIGH_MAX_NEAR_UNITY = 0x3fefffff|0; // asm type annotation\n\nvar HUGE = 1.0e300;\nvar TINY = 1.0e-300;\n\n\n// MAIN //\n\n/**\n* Evaluates the exponential function when \\\\(|y| > 2^64\\\\).\n*\n* @private\n* @param {number} x - base\n* @param {number} y - exponent\n* @returns {number} overflow or underflow result\n*\n* @example\n* var v = pow( 9.0, 3.6893488147419103e19 );\n* // returns Infinity\n*\n* @example\n* var v = pow( -3.14, -3.6893488147419103e19 );\n* // returns 0.0\n*/\nfunction pow( x, y ) {\n\tvar ahx;\n\tvar hx;\n\n\thx = getHighWord( x );\n\tahx = (hx & ABS_MASK);\n\n\tif ( ahx <= HIGH_MAX_NEAR_UNITY ) {\n\t\tif ( y < 0 ) {\n\t\t\t// Signal overflow...\n\t\t\treturn HUGE * HUGE;\n\t\t}\n\t\t// Signal underflow...\n\t\treturn TINY * TINY;\n\t}\n\t// `x` has a biased exponent greater than or equal to `0`...\n\n\tif ( y > 0 ) {\n\t\t// Signal overflow...\n\t\treturn HUGE * HUGE;\n\t}\n\t// Signal underflow...\n\treturn TINY * TINY;\n}\n\n\n// EXPORTS //\n\nexport default pow;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isLittleEndian from '@stdlib/assert-is-little-endian';\n\n\n// MAIN //\n\nvar HIGH;\nif ( isLittleEndian === true ) {\n\tHIGH = 1; // second index\n} else {\n\tHIGH = 0; // first index\n}\n\n\n// EXPORTS //\n\nexport default HIGH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float64Array from '@stdlib/array-float64';\nimport HIGH from './high.js';\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\n\n// MAIN //\n\n/**\n* Sets the more significant 32 bits of a double-precision floating-point number.\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {number} x - double\n* @param {uinteger32} high - unsigned 32-bit integer to replace the higher order word of `x`\n* @returns {number} double having the same lower order word as `x`\n*\n* @example\n* var high = 5 >>> 0; // => 0 00000000000 00000000000000000101\n*\n* var y = setHighWord( 3.14e201, high ); // => 0 00000000000 0000000000000000010110010011110010110101100010000010\n* // returns 1.18350528745e-313\n*\n* @example\n* import PINF from '@stdlib/constants-float64-pinf'; // => 0 11111111111 00000000000000000000 00000000000000000000000000000000\n*\n* var high = 1072693248 >>> 0; // => 0 01111111111 00000000000000000000\n*\n* // Set the higher order bits of `+infinity` to return `1`:\n* var y = setHighWord( PINF, high ); // => 0 01111111111 0000000000000000000000000000000000000000000000000000\n* // returns 1.0\n*/\nfunction setHighWord( x, high ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\tUINT32_VIEW[ HIGH ] = ( high >>> 0 ); // identity bit shift to ensure integer\n\treturn FLOAT64_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nexport default setHighWord;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The bias of a double-precision floating-point number's exponent.\n*\n* @module @stdlib/constants-float64-exponent-bias\n* @type {integer32}\n*\n* @example\n* import FLOAT64_EXPONENT_BIAS from '@stdlib/constants-float64-exponent-bias';\n* // returns 1023\n*/\n\n\n// MAIN //\n\n/**\n* Bias of a double-precision floating-point number's exponent.\n*\n* ## Notes\n*\n* The bias can be computed via\n*\n* ```tex\n* \\mathrm{bias} = 2^{k-1} - 1\n* ```\n*\n* where \\\\(k\\\\) is the number of bits in the exponent; here, \\\\(k = 11\\\\).\n*\n* @constant\n* @type {integer32}\n* @default 1023\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_EXPONENT_BIAS = 1023|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default FLOAT64_EXPONENT_BIAS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getHighWord from '@stdlib/number-float64-base-get-high-word';\nimport setLowWord from '@stdlib/number-float64-base-set-low-word';\nimport setHighWord from '@stdlib/number-float64-base-set-high-word';\nimport BIAS from '@stdlib/constants-float64-exponent-bias';\nimport polyvalL from './polyval_l.js';\n\n\n// VARIABLES //\n\n// 0x000fffff = 1048575 => 0 00000000000 11111111111111111111\nvar HIGH_SIGNIFICAND_MASK = 0x000fffff|0; // asm type annotation\n\n// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022\nvar HIGH_MIN_NORMAL_EXP = 0x00100000|0; // asm type annotation\n\n// 0x3ff00000 = 1072693248 => 0 01111111111 00000000000000000000 => biased exponent: 1023 = 0+1023 => 2^0 = 1\nvar HIGH_BIASED_EXP_0 = 0x3ff00000|0; // asm type annotation\n\n// 0x20000000 = 536870912 => 0 01000000000 00000000000000000000 => biased exponent: 512 = -511+1023\nvar HIGH_BIASED_EXP_NEG_512 = 0x20000000|0; // asm type annotation\n\n// 0x00080000 = 524288 => 0 00000000000 10000000000000000000\nvar HIGH_SIGNIFICAND_HALF = 0x00080000|0; // asm type annotation\n\n// TODO: consider making an external constant\nvar HIGH_NUM_SIGNIFICAND_BITS = 20|0; // asm type annotation\n\nvar TWO53 = 9007199254740992.0;\t// 0x43400000, 0x00000000\n\n// 2/(3*LN2)\nvar CP = 9.61796693925975554329e-01; // 0x3FEEC709, 0xDC3A03FD\n\n// (float)CP\nvar CP_HI = 9.61796700954437255859e-01; // 0x3FEEC709, 0xE0000000\n\n// Low: CP_HI\nvar CP_LO = -7.02846165095275826516e-09; // 0xBE3E2FE0, 0x145B01F5\n\nvar BP = [\n\t1.0,\n\t1.5\n];\nvar DP_HI = [\n\t0.0,\n\t5.84962487220764160156e-01 // 0x3FE2B803, 0x40000000\n];\nvar DP_LO = [\n\t0.0,\n\t1.35003920212974897128e-08 // 0x3E4CFDEB, 0x43CFD006\n];\n\n\n// MAIN //\n\n/**\n* Computes \\\\(\\operatorname{log2}(ax)\\\\).\n*\n* @private\n* @param {Array} out - output array\n* @param {number} ax - absolute value of `x`\n* @param {number} ahx - high word of `ax`\n* @returns {Array} output array containing a tuple comprised of high and low parts\n*\n* @example\n* var t = log2ax( [ 0.0, 0.0 ], 9.0, 1075970048 ); // => [ t1, t2 ]\n* // returns [ 3.169923782348633, 0.0000012190936795504075 ]\n*/\nfunction log2ax( out, ax, ahx ) {\n\tvar tmp;\n\tvar ss; // `hs + ls`\n\tvar s2; // `ss` squared\n\tvar hs;\n\tvar ls;\n\tvar ht;\n\tvar lt;\n\tvar bp; // `BP` constant\n\tvar dp; // `DP` constant\n\tvar hp;\n\tvar lp;\n\tvar hz;\n\tvar lz;\n\tvar t1;\n\tvar t2;\n\tvar t;\n\tvar r;\n\tvar u;\n\tvar v;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tn = 0|0; // asm type annotation\n\n\t// Check if `x` is subnormal...\n\tif ( ahx < HIGH_MIN_NORMAL_EXP ) {\n\t\tax *= TWO53;\n\t\tn -= 53|0; // asm type annotation\n\t\tahx = getHighWord( ax );\n\t}\n\t// Extract the unbiased exponent of `x`:\n\tn += ((ahx >> HIGH_NUM_SIGNIFICAND_BITS) - BIAS)|0; // asm type annotation\n\n\t// Isolate the significand bits of `x`:\n\tj = (ahx & HIGH_SIGNIFICAND_MASK)|0; // asm type annotation\n\n\t// Normalize `ahx` by setting the (biased) exponent to `1023`:\n\tahx = (j | HIGH_BIASED_EXP_0)|0; // asm type annotation\n\n\t// Determine the interval of `|x|` by comparing significand bits...\n\n\t// |x| < sqrt(3/2)\n\tif ( j <= 0x3988E ) { // 0 00000000000 00111001100010001110\n\t\tk = 0;\n\t}\n\t// |x| < sqrt(3)\n\telse if ( j < 0xBB67A ) { // 0 00000000000 10111011011001111010\n\t\tk = 1;\n\t}\n\t// |x| >= sqrt(3)\n\telse {\n\t\tk = 0;\n\t\tn += 1|0; // asm type annotation\n\t\tahx -= HIGH_MIN_NORMAL_EXP;\n\t}\n\t// Load the normalized high word into `|x|`:\n\tax = setHighWord( ax, ahx );\n\n\t// Compute `ss = hs + ls = (x-1)/(x+1)` or `(x-1.5)/(x+1.5)`:\n\tbp = BP[ k ]; // BP[0] = 1.0, BP[1] = 1.5\n\tu = ax - bp; // (x-1) || (x-1.5)\n\tv = 1.0 / (ax + bp); // 1/(x+1) || 1/(x+1.5)\n\tss = u * v;\n\ths = setLowWord( ss, 0 ); // set all low word (less significant significand) bits to 0s\n\n\t// Compute `ht = ax + bp` (via manipulation, i.e., bit flipping, of the high word):\n\ttmp = ((ahx>>1) | HIGH_BIASED_EXP_NEG_512) + HIGH_SIGNIFICAND_HALF;\n\ttmp += (k << 18); // `(k<<18)` can be considered the word equivalent of `1.0` or `1.5`\n\tht = setHighWord( 0.0, tmp );\n\tlt = ax - (ht - bp);\n\tls = v * ( ( u - (hs*ht) ) - ( hs*lt ) );\n\n\t// Compute `log(ax)`...\n\n\ts2 = ss * ss;\n\tr = s2 * s2 * polyvalL( s2 );\n\tr += ls * (hs + ss);\n\ts2 = hs * hs;\n\tht = 3.0 + s2 + r;\n\tht = setLowWord( ht, 0 );\n\tlt = r - ((ht-3.0) - s2);\n\n\t// u+v = ss*(1+...):\n\tu = hs * ht;\n\tv = ( ls*ht ) + ( lt*ss );\n\n\t// 2/(3LN2) * (ss+...):\n\thp = u + v;\n\thp = setLowWord( hp, 0 );\n\tlp = v - (hp - u);\n\thz = CP_HI * hp; // CP_HI+CP_LO = 2/(3*LN2)\n\tlz = ( CP_LO*hp ) + ( lp*CP ) + DP_LO[ k ];\n\n\t// log2(ax) = (ss+...)*2/(3*LN2) = n + dp + hz + lz\n\tdp = DP_HI[ k ];\n\tt = n;\n\tt1 = ((hz+lz) + dp) + t; // log2(ax)\n\tt1 = setLowWord( t1, 0 );\n\tt2 = lz - (((t1-t) - dp) - hz);\n\n\tout[ 0 ] = t1;\n\tout[ 1 ] = t2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default log2ax;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport setLowWord from '@stdlib/number-float64-base-set-low-word';\nimport polyvalW from './polyval_w.js';\n\n\n// VARIABLES //\n\n// 1/LN2\nvar INV_LN2 = 1.44269504088896338700e+00; // 0x3FF71547, 0x652B82FE\n\n// High (24 bits): 1/LN2\nvar INV_LN2_HI = 1.44269502162933349609e+00; // 0x3FF71547, 0x60000000\n\n// Low: 1/LN2\nvar INV_LN2_LO = 1.92596299112661746887e-08; // 0x3E54AE0B, 0xF85DDF44\n\n\n// MAIN //\n\n/**\n* Computes \\\\(\\operatorname{log}(x)\\\\) assuming \\\\(|1-x|\\\\) is small and using the approximation \\\\(x - x^2/2 + x^3/3 - x^4/4\\\\).\n*\n* @private\n* @param {Array} out - output array\n* @param {number} ax - absolute value of `x`\n* @returns {Array} output array containing a tuple comprised of high and low parts\n*\n* @example\n* var t = logx( [ 0.0, 0.0 ], 9.0 ); // => [ t1, t2 ]\n* // returns [ -1265.7236328125, -0.0008163940840404393 ]\n*/\nfunction logx( out, ax ) {\n\tvar t2;\n\tvar t1;\n\tvar t;\n\tvar w;\n\tvar u;\n\tvar v;\n\n\tt = ax - 1.0; // `t` has `20` trailing zeros\n\tw = t * t * polyvalW( t );\n\tu = INV_LN2_HI * t; // `INV_LN2_HI` has `21` significant bits\n\tv = ( t*INV_LN2_LO ) - ( w*INV_LN2 );\n\tt1 = u + v;\n\tt1 = setLowWord( t1, 0 );\n\tt2 = v - (t1 - u);\n\n\tout[ 0 ] = t1;\n\tout[ 1 ] = t2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default logx;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The maximum biased base 2 exponent for a double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-max-base2-exponent\n* @type {integer32}\n*\n* @example\n* import FLOAT64_MAX_BASE2_EXPONENT from '@stdlib/constants-float64-max-base2-exponent';\n* // returns 1023\n*/\n\n\n// MAIN //\n\n/**\n* The maximum biased base 2 exponent for a double-precision floating-point number.\n*\n* ```text\n* 11111111110 => 2046 - BIAS = 1023\n* ```\n*\n* where `BIAS = 1023`.\n*\n* @constant\n* @type {integer32}\n* @default 1023\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_MAX_BASE2_EXPONENT = 1023|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default FLOAT64_MAX_BASE2_EXPONENT;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The maximum biased base 2 exponent for a subnormal double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-max-base2-exponent-subnormal\n* @type {integer32}\n*\n* @example\n* import FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL from '@stdlib/constants-float64-max-base2-exponent-subnormal';\n* // returns -1023\n*/\n\n\n// MAIN //\n\n/**\n* The maximum biased base 2 exponent for a subnormal double-precision floating-point number.\n*\n* ```text\n* 00000000000 => 0 - BIAS = -1023\n* ```\n*\n* where `BIAS = 1023`.\n*\n* @constant\n* @type {integer32}\n* @default -1023\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL = -1023|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The minimum biased base 2 exponent for a subnormal double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-min-base2-exponent-subnormal\n* @type {integer32}\n*\n* @example\n* import FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL from '@stdlib/constants-float64-min-base2-exponent-subnormal';\n* // returns -1074\n*/\n\n\n// MAIN //\n\n/**\n* The minimum biased base 2 exponent for a subnormal double-precision floating-point number.\n*\n* ```text\n* -(BIAS+(52-1)) = -(1023+51) = -1074\n* ```\n*\n* where `BIAS = 1023` and `52` is the number of digits in the significand.\n*\n* @constant\n* @type {integer32}\n* @default -1074\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL = -1074|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Smallest positive double-precision floating-point normal number.\n*\n* @module @stdlib/constants-float64-smallest-normal\n* @type {number}\n*\n* @example\n* import FLOAT64_SMALLEST_NORMAL from '@stdlib/constants-float64-smallest-normal';\n* // returns 2.2250738585072014e-308\n*/\n\n\n// MAIN //\n\n/**\n* The smallest positive double-precision floating-point normal number.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* \\frac{1}{2^{1023-1}}\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 00000000001 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default 2.2250738585072014e-308\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_SMALLEST_NORMAL = 2.2250738585072014e-308;\n\n\n// EXPORTS //\n\nexport default FLOAT64_SMALLEST_NORMAL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport FLOAT64_SMALLEST_NORMAL from '@stdlib/constants-float64-smallest-normal';\nimport isInfinite from '@stdlib/math-base-assert-is-infinite';\nimport isnan from '@stdlib/math-base-assert-is-nan';\nimport abs from '@stdlib/math-base-special-abs';\n\n\n// VARIABLES //\n\n// (1<<52)\nvar SCALAR = 4503599627370496;\n\n\n// MAIN //\n\n/**\n* Returns a normal number `y` and exponent `exp` satisfying \\\\(x = y \\cdot 2^\\mathrm{exp}\\\\) and assigns results to a provided output array.\n*\n* @param {number} x - input value\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* import pow from '@stdlib/math-base-special-pow';\n*\n* var out = normalize( 3.14e-319, [ 0.0, 0 ], 1, 0 );\n* // returns [ 1.4141234400356668e-303, -52 ]\n*\n* var y = out[ 0 ];\n* var exp = out[ 1 ];\n*\n* var bool = ( y*pow(2.0,exp) === 3.14e-319 );\n* // returns true\n*\n* @example\n* var out = normalize( 0.0, [ 0.0, 0 ], 1, 0 );\n* // returns [ 0.0, 0 ];\n*\n* @example\n* import PINF from '@stdlib/constants-float64-pinf';\n*\n* var out = normalize( PINF, [ 0.0, 0 ], 1, 0 );\n* // returns [ Infinity, 0 ]\n*\n* @example\n* import NINF from '@stdlib/constants-float64-ninf';\n*\n* var out = normalize( NINF, [ 0.0, 0 ], 1, 0 );\n* // returns [ -Infinity, 0 ]\n*\n* @example\n* var out = normalize( NaN, [ 0.0, 0 ], 1, 0 );\n* // returns [ NaN, 0 ]\n*/\nfunction normalize( x, out, stride, offset ) {\n\tif ( isnan( x ) || isInfinite( x ) ) {\n\t\tout[ offset ] = x;\n\t\tout[ offset + stride ] = 0;\n\t\treturn out;\n\t}\n\tif ( x !== 0.0 && abs( x ) < FLOAT64_SMALLEST_NORMAL ) {\n\t\tout[ offset ] = x * SCALAR;\n\t\tout[ offset + stride ] = -52;\n\t\treturn out;\n\t}\n\tout[ offset ] = x;\n\tout[ offset + stride ] = 0;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default normalize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a normal number `y` and exponent `exp` satisfying \\\\(x = y \\cdot 2^\\mathrm{exp}\\\\).\n*\n* @module @stdlib/number-float64-base-normalize\n*\n* @example\n* import normalize from '@stdlib/number-float64-base-normalize';\n* import pow from '@stdlib/math-base-special-pow';\n*\n* var out = normalize( 3.14e-319 );\n* // returns [ 1.4141234400356668e-303, -52 ]\n*\n* var y = out[ 0 ];\n* var exp = out[ 1 ];\n*\n* var bool = ( y*pow(2.0, exp) === 3.14e-319 );\n* // returns true\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n* import normalize from '@stdlib/number-float64-base-normalize';\n*\n* var out = new Float64Array( 2 );\n*\n* var v = normalize.assign( 3.14e-319, out, 1, 0 );\n* // returns [ 1.4141234400356668e-303, -52 ]\n*\n* var bool = ( v === out );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport fcn from './assign.js';\n\n\n// MAIN //\n\n/**\n* Returns a normal number `y` and exponent `exp` satisfying \\\\(x = y \\cdot 2^\\mathrm{exp}\\\\).\n*\n* @param {number} x - input value\n* @returns {NumberArray} output array\n*\n* @example\n* import pow from '@stdlib/math-base-special-pow';\n*\n* var out = normalize( 3.14e-319 );\n* // returns [ 1.4141234400356668e-303, -52 ]\n*\n* var y = out[ 0 ];\n* var exp = out[ 1 ];\n*\n* var bool = ( y*pow(2.0,exp) === 3.14e-319 );\n* // returns true\n*\n* @example\n* var out = normalize( 0.0 );\n* // returns [ 0.0, 0 ]\n*\n* @example\n* import PINF from '@stdlib/constants-float64-pinf';\n*\n* var out = normalize( PINF );\n* // returns [ Infinity, 0 ]\n*\n* @example\n* import NINF from '@stdlib/constants-float64-ninf';\n*\n* var out = normalize( NINF );\n* // returns [ -Infinity, 0 ]\n*\n* @example\n* var out = normalize( NaN );\n* // returns [ NaN, 0 ]\n*/\nfunction normalize( x ) {\n\treturn fcn( x, [ 0.0, 0 ], 1, 0 );\n}\n\n\n// EXPORTS //\n\nexport default normalize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* High word mask for the exponent of a double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-high-word-exponent-mask\n* @type {uinteger32}\n*\n* @example\n* import FLOAT64_HIGH_WORD_EXPONENT_MASK from '@stdlib/constants-float64-high-word-exponent-mask';\n* // returns 2146435072\n*/\n\n\n// MAIN //\n\n/**\n* High word mask for the exponent of a double-precision floating-point number.\n*\n* ## Notes\n*\n* The high word mask for the exponent of a double-precision floating-point number is an unsigned 32-bit integer with the value \\\\( 2146435072 \\\\), which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 11111111111 00000000000000000000\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 0x7ff00000\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_HIGH_WORD_EXPONENT_MASK = 0x7ff00000;\n\n\n// EXPORTS //\n\nexport default FLOAT64_HIGH_WORD_EXPONENT_MASK;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// NOTES //\n\n/*\n* => ldexp: load exponent (see [The Open Group]{@link http://pubs.opengroup.org/onlinepubs/9699919799/functions/ldexp.html} and [cppreference]{@link http://en.cppreference.com/w/c/numeric/math/ldexp}).\n*/\n\n\n// MODULES //\n\nimport PINF from '@stdlib/constants-float64-pinf';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport BIAS from '@stdlib/constants-float64-exponent-bias';\nimport MAX_EXPONENT from '@stdlib/constants-float64-max-base2-exponent';\nimport MAX_SUBNORMAL_EXPONENT from '@stdlib/constants-float64-max-base2-exponent-subnormal';\nimport MIN_SUBNORMAL_EXPONENT from '@stdlib/constants-float64-min-base2-exponent-subnormal';\nimport isnan from '@stdlib/math-base-assert-is-nan';\nimport isInfinite from '@stdlib/math-base-assert-is-infinite';\nimport copysign from '@stdlib/math-base-special-copysign';\nimport { assign as normalize } from '@stdlib/number-float64-base-normalize';\nimport floatExp from '@stdlib/number-float64-base-exponent';\nimport toWords from '@stdlib/number-float64-base-to-words';\nimport fromWords from '@stdlib/number-float64-base-from-words';\n\n\n// VARIABLES //\n\n// 1/(1<<52) = 1/(2**52) = 1/4503599627370496\nvar TWO52_INV = 2.220446049250313e-16;\n\n// Exponent all 0s: 1 00000000000 11111111111111111111 => 2148532223\nvar CLEAR_EXP_MASK = 0x800fffff>>>0; // asm type annotation\n\n// Normalization workspace:\nvar FRAC = [ 0.0, 0.0 ];\n\n// High/low words workspace:\nvar WORDS = [ 0, 0 ];\n\n\n// MAIN //\n\n/**\n* Multiplies a double-precision floating-point number by an integer power of two.\n*\n* @param {number} frac - fraction\n* @param {integer} exp - exponent\n* @returns {number} double-precision floating-point number\n*\n* @example\n* var x = ldexp( 0.5, 3 ); // => 0.5 * 2^3 = 0.5 * 8\n* // returns 4.0\n*\n* @example\n* var x = ldexp( 4.0, -2 ); // => 4 * 2^(-2) = 4 * (1/4)\n* // returns 1.0\n*\n* @example\n* var x = ldexp( 0.0, 20 );\n* // returns 0.0\n*\n* @example\n* var x = ldexp( -0.0, 39 );\n* // returns -0.0\n*\n* @example\n* var x = ldexp( NaN, -101 );\n* // returns NaN\n*\n* @example\n* var x = ldexp( Infinity, 11 );\n* // returns Infinity\n*\n* @example\n* var x = ldexp( -Infinity, -118 );\n* // returns -Infinity\n*/\nfunction ldexp( frac, exp ) {\n\tvar high;\n\tvar m;\n\tif (\n\t\texp === 0 ||\n\t\tfrac === 0.0 || // handles +-0\n\t\tisnan( frac ) ||\n\t\tisInfinite( frac )\n\t) {\n\t\treturn frac;\n\t}\n\t// Normalize the input fraction:\n\tnormalize( frac, FRAC, 1, 0 );\n\tfrac = FRAC[ 0 ];\n\texp += FRAC[ 1 ];\n\n\t// Extract the exponent from `frac` and add it to `exp`:\n\texp += floatExp( frac );\n\n\t// Check for underflow/overflow...\n\tif ( exp < MIN_SUBNORMAL_EXPONENT ) {\n\t\treturn copysign( 0.0, frac );\n\t}\n\tif ( exp > MAX_EXPONENT ) {\n\t\tif ( frac < 0.0 ) {\n\t\t\treturn NINF;\n\t\t}\n\t\treturn PINF;\n\t}\n\t// Check for a subnormal and scale accordingly to retain precision...\n\tif ( exp <= MAX_SUBNORMAL_EXPONENT ) {\n\t\texp += 52;\n\t\tm = TWO52_INV;\n\t} else {\n\t\tm = 1.0;\n\t}\n\t// Split the fraction into higher and lower order words:\n\ttoWords.assign( frac, WORDS, 1, 0 );\n\thigh = WORDS[ 0 ];\n\n\t// Clear the exponent bits within the higher order word:\n\thigh &= CLEAR_EXP_MASK;\n\n\t// Set the exponent bits to the new exponent:\n\thigh |= ((exp+BIAS) << 20);\n\n\t// Create a new floating-point number:\n\treturn m * fromWords( high, WORDS[ 1 ] );\n}\n\n\n// EXPORTS //\n\nexport default ldexp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getHighWord from '@stdlib/number-float64-base-get-high-word';\nimport EXP_MASK from '@stdlib/constants-float64-high-word-exponent-mask';\nimport BIAS from '@stdlib/constants-float64-exponent-bias';\n\n\n// MAIN //\n\n/**\n* Returns an integer corresponding to the unbiased exponent of a double-precision floating-point number.\n*\n* @param {number} x - input value\n* @returns {integer32} unbiased exponent\n*\n* @example\n* var exp = exponent( 3.14e-307 ); // => 2**-1019 ~ 1e-307\n* // returns -1019\n*\n* @example\n* var exp = exponent( -3.14 );\n* // returns 1\n*\n* @example\n* var exp = exponent( 0.0 );\n* // returns -1023\n*\n* @example\n* var exp = exponent( NaN );\n* // returns 1024\n*/\nfunction exponent( x ) {\n\t// Extract from the input value a higher order word (unsigned 32-bit integer) which contains the exponent:\n\tvar high = getHighWord( x );\n\n\t// Apply a mask to isolate only the exponent bits and then shift off all bits which are part of the fraction:\n\thigh = ( high & EXP_MASK ) >>> 20;\n\n\t// Remove the bias and return:\n\treturn (high - BIAS)|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nexport default exponent;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Natural logarithm of `2`.\n*\n* @module @stdlib/constants-float64-ln-two\n* @type {number}\n*\n* @example\n* import LN2 from '@stdlib/constants-float64-ln-two';\n* // returns 0.6931471805599453\n*/\n\n\n// MAIN //\n\n/**\n* Natural logarithm of `2`.\n*\n* ```tex\n* \\ln 2\n* ```\n*\n* @constant\n* @type {number}\n* @default 0.6931471805599453\n*/\nvar LN2 = 6.93147180559945309417232121458176568075500134360255254120680009493393621969694715605863326996418687542001481021e-01; // eslint-disable-line max-len\n\n\n// EXPORTS //\n\nexport default LN2;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* High word mask for the significand of a double-precision floating-point number.\n*\n* @module @stdlib/constants-float64-high-word-significand-mask\n* @type {uinteger32}\n*\n* @example\n* import FLOAT64_HIGH_WORD_SIGNIFICAND_MASK from '@stdlib/constants-float64-high-word-significand-mask';\n* // returns 1048575\n*/\n\n\n// MAIN //\n\n/**\n* High word mask for the significand of a double-precision floating-point number.\n*\n* ## Notes\n*\n* The high word mask for the significand of a double-precision floating-point number is an unsigned 32-bit integer with the value \\\\( 1048575 \\\\), which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 00000000000 11111111111111111111\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 0x000fffff\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = 0x000fffff;\n\n\n// EXPORTS //\n\nexport default FLOAT64_HIGH_WORD_SIGNIFICAND_MASK;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getHighWord from '@stdlib/number-float64-base-get-high-word';\nimport setHighWord from '@stdlib/number-float64-base-set-high-word';\nimport setLowWord from '@stdlib/number-float64-base-set-low-word';\nimport uint32ToInt32 from '@stdlib/number-uint32-base-to-int32';\nimport ldexp from '@stdlib/math-base-special-ldexp';\nimport LN2 from '@stdlib/constants-float64-ln-two';\nimport BIAS from '@stdlib/constants-float64-exponent-bias';\nimport ABS_MASK from '@stdlib/constants-float64-high-word-abs-mask';\nimport HIGH_SIGNIFICAND_MASK from '@stdlib/constants-float64-high-word-significand-mask';\nimport polyvalP from './polyval_p.js';\n\n\n// VARIABLES //\n\n// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022\nvar HIGH_MIN_NORMAL_EXP = 0x00100000|0; // asm type annotation\n\n// 0x3fe00000 = 1071644672 => 0 01111111110 00000000000000000000 => biased exponent: 1022 = -1+1023 => 2^-1\nvar HIGH_BIASED_EXP_NEG_1 = 0x3fe00000|0; // asm type annotation\n\n// TODO: consider making into an external constant\nvar HIGH_NUM_SIGNIFICAND_BITS = 20|0; // asm type annotation\n\n// High: LN2\nvar LN2_HI = 6.93147182464599609375e-01; // 0x3FE62E43, 0x00000000\n\n// Low: LN2\nvar LN2_LO = -1.90465429995776804525e-09; // 0xBE205C61, 0x0CA86C39\n\n\n// MAIN //\n\n/**\n* Computes \\\\(2^{\\mathrm{hp} + \\mathrm{lp}\\\\).\n*\n* @private\n* @param {number} j - high word of `hp + lp`\n* @param {number} hp - first power summand\n* @param {number} lp - second power summand\n* @returns {number} function value\n*\n* @example\n* var z = pow2( 1065961648, -0.3398475646972656, -0.000002438187359100815 );\n* // returns ~0.79\n*/\nfunction pow2( j, hp, lp ) {\n\tvar tmp;\n\tvar t1;\n\tvar t;\n\tvar r;\n\tvar u;\n\tvar v;\n\tvar w;\n\tvar z;\n\tvar n;\n\tvar i;\n\tvar k;\n\n\ti = (j & ABS_MASK)|0; // asm type annotation\n\tk = ((i>>HIGH_NUM_SIGNIFICAND_BITS) - BIAS)|0; // asm type annotation\n\tn = 0;\n\n\t// `|z| > 0.5`, set `n = z+0.5`\n\tif ( i > HIGH_BIASED_EXP_NEG_1 ) {\n\t\tn = (j + (HIGH_MIN_NORMAL_EXP>>(k+1)))>>>0; // asm type annotation\n\t\tk = (((n & ABS_MASK)>>HIGH_NUM_SIGNIFICAND_BITS) - BIAS)|0; // new k for n\n\t\ttmp = ((n & ~(HIGH_SIGNIFICAND_MASK >> k)))>>>0; // asm type annotation\n\t\tt = setHighWord( 0.0, tmp );\n\t\tn = (((n & HIGH_SIGNIFICAND_MASK)|HIGH_MIN_NORMAL_EXP) >> (HIGH_NUM_SIGNIFICAND_BITS-k))>>>0; // eslint-disable-line max-len\n\t\tif ( j < 0 ) {\n\t\t\tn = -n;\n\t\t}\n\t\thp -= t;\n\t}\n\tt = lp + hp;\n\tt = setLowWord( t, 0 );\n\tu = t * LN2_HI;\n\tv = ( (lp - (t-hp))*LN2 ) + ( t*LN2_LO );\n\tz = u + v;\n\tw = v - (z - u);\n\tt = z * z;\n\tt1 = z - ( t*polyvalP( t ) );\n\tr = ( (z*t1) / (t1-2.0) ) - ( w + (z*w) );\n\tz = 1.0 - (r - z);\n\tj = getHighWord( z );\n\tj = uint32ToInt32( j );\n\tj += (n << HIGH_NUM_SIGNIFICAND_BITS)>>>0; // asm type annotation\n\n\t// Check for subnormal output...\n\tif ( (j>>HIGH_NUM_SIGNIFICAND_BITS) <= 0 ) {\n\t\tz = ldexp( z, n );\n\t} else {\n\t\tz = setHighWord( z, j );\n\t}\n\treturn z;\n}\n\n\n// EXPORTS //\n\nexport default pow2;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isnan from '@stdlib/math-base-assert-is-nan';\nimport isOdd from '@stdlib/math-base-assert-is-odd';\nimport isInfinite from '@stdlib/math-base-assert-is-infinite';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport sqrt from '@stdlib/math-base-special-sqrt';\nimport abs from '@stdlib/math-base-special-abs';\nimport toWords from '@stdlib/number-float64-base-to-words';\nimport setLowWord from '@stdlib/number-float64-base-set-low-word';\nimport uint32ToInt32 from '@stdlib/number-uint32-base-to-int32';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport PINF from '@stdlib/constants-float64-pinf';\nimport ABS_MASK from '@stdlib/constants-float64-high-word-abs-mask';\nimport xIsZero from './x_is_zero.js';\nimport yIsHuge from './y_is_huge.js';\nimport yIsInfinite from './y_is_infinite.js';\nimport log2ax from './log2ax.js';\nimport logx from './logx.js';\nimport pow2 from './pow2.js';\n\n\n// VARIABLES //\n\n// 0x3fefffff = 1072693247 => 0 01111111110 11111111111111111111 => biased exponent: 1022 = -1+1023 => 2^-1\nvar HIGH_MAX_NEAR_UNITY = 0x3fefffff|0; // asm type annotation\n\n// 0x41e00000 = 1105199104 => 0 10000011110 00000000000000000000 => biased exponent: 1054 = 31+1023 => 2^31\nvar HIGH_BIASED_EXP_31 = 0x41e00000|0; // asm type annotation\n\n// 0x43f00000 = 1139802112 => 0 10000111111 00000000000000000000 => biased exponent: 1087 = 64+1023 => 2^64\nvar HIGH_BIASED_EXP_64 = 0x43f00000|0; // asm type annotation\n\n// 0x40900000 = 1083179008 => 0 10000001001 00000000000000000000 => biased exponent: 1033 = 10+1023 => 2^10 = 1024\nvar HIGH_BIASED_EXP_10 = 0x40900000|0; // asm type annotation\n\n// 0x3ff00000 = 1072693248 => 0 01111111111 00000000000000000000 => biased exponent: 1023 = 0+1023 => 2^0 = 1\nvar HIGH_BIASED_EXP_0 = 0x3ff00000|0; // asm type annotation\n\n// 0x4090cc00 = 1083231232 => 0 10000001001 00001100110000000000\nvar HIGH_1075 = 0x4090cc00|0; // asm type annotation\n\n// 0xc090cc00 = 3230714880 => 1 10000001001 00001100110000000000\nvar HIGH_NEG_1075 = 0xc090cc00>>>0; // asm type annotation\n\nvar HIGH_NUM_NONSIGN_BITS = 31|0; // asm type annotation\n\nvar HUGE = 1.0e300;\nvar TINY = 1.0e-300;\n\n// -(1024-log2(ovfl+.5ulp))\nvar OVT = 8.0085662595372944372e-17;\n\n// High/low words workspace:\nvar WORDS = [ 0|0, 0|0 ];\n\n// Log workspace:\nvar LOG_WORKSPACE = [ 0.0, 0.0 ];\n\n\n// MAIN //\n\n/**\n* Evaluates the exponential function.\n*\n* ## Method\n*\n* 1. Let \\\\(x = 2^n (1+f)\\\\).\n*\n* 2. Compute \\\\(\\operatorname{log2}(x)\\\\) as\n*\n* ```tex\n* \\operatorname{log2}(x) = w_1 + w_2\n* ```\n*\n* where \\\\(w_1\\\\) has \\\\(53 - 24 = 29\\\\) bit trailing zeros.\n*\n* 3. Compute\n*\n* ```tex\n* y \\cdot \\operatorname{log2}(x) = n + y^\\prime\n* ```\n*\n* by simulating multi-precision arithmetic, where \\\\(|y^\\prime| \\leq 0.5\\\\).\n*\n* 4. Return\n*\n* ```tex\n* x^y = 2^n e^{y^\\prime \\cdot \\mathrm{log2}}\n* ```\n*\n* ## Special Cases\n*\n* ```tex\n* \\begin{align*}\n* x^{\\mathrm{NaN}} &= \\mathrm{NaN} & \\\\\n* (\\mathrm{NaN})^y &= \\mathrm{NaN} & \\\\\n* 1^y &= 1 & \\\\\n* x^0 &= 1 & \\\\\n* x^1 &= x & \\\\\n* (\\pm 0)^\\infty &= +0 & \\\\\n* (\\pm 0)^{-\\infty} &= +\\infty & \\\\\n* (+0)^y &= +0 & \\mathrm{if}\\ y > 0 \\\\\n* (+0)^y &= +\\infty & \\mathrm{if}\\ y < 0 \\\\\n* (-0)^y &= -\\infty & \\mathrm{if}\\ y\\ \\mathrm{is\\ an\\ odd\\ integer\\ and}\\ y < 0 \\\\\n* (-0)^y &= +\\infty & \\mathrm{if}\\ y\\ \\mathrm{is\\ not\\ an\\ odd\\ integer\\ and}\\ y < 0 \\\\\n* (-0)^y &= -0 & \\mathrm{if}\\ y\\ \\mathrm{is\\ an\\ odd\\ integer\\ and}\\ y > 0 \\\\\n* (-0)^y &= +0 & \\mathrm{if}\\ y\\ \\mathrm{is\\ not\\ an\\ odd\\ integer\\ and}\\ y > 0 \\\\\n* (-1)^{\\pm\\infty} &= \\mathrm{NaN} & \\\\\n* x^{\\infty} &= +\\infty & |x| > 1 \\\\\n* x^{\\infty} &= +0 & |x| < 1 \\\\\n* x^{-\\infty} &= +0 & |x| > 1 \\\\\n* x^{-\\infty} &= +\\infty & |x| < 1 \\\\\n* (-\\infty)^y &= (-0)^y & \\\\\n* \\infty^y &= +0 & y < 0 \\\\\n* \\infty^y &= +\\infty & y > 0 \\\\\n* x^y &= \\mathrm{NaN} & \\mathrm{if}\\ y\\ \\mathrm{is\\ not\\ a\\ finite\\ integer\\ and}\\ x < 0\n* \\end{align*}\n* ```\n*\n* ## Notes\n*\n* - \\\\(\\operatorname{pow}(x,y)\\\\) returns \\\\(x^y\\\\) nearly rounded. In particular, \\\\(\\operatorname{pow}(<\\mathrm{integer}>,<\\mathrm{integer}>)\\\\) **always** returns the correct integer, provided the value is representable.\n* - The hexadecimal values shown in the source code are the intended values for used constants. Decimal values may be used, provided the compiler will accurately convert decimal to binary in order to produce the hexadecimal values.\n*\n* @param {number} x - base\n* @param {number} y - exponent\n* @returns {number} function value\n*\n* @example\n* var v = pow( 2.0, 3.0 );\n* // returns 8.0\n*\n* @example\n* var v = pow( 4.0, 0.5 );\n* // returns 2.0\n*\n* @example\n* var v = pow( 100.0, 0.0 );\n* // returns 1.0\n*\n* @example\n* var v = pow( 3.141592653589793, 5.0 );\n* // returns ~306.0197\n*\n* @example\n* var v = pow( 3.141592653589793, -0.2 );\n* // returns ~0.7954\n*\n* @example\n* var v = pow( NaN, 3.0 );\n* // returns NaN\n*\n* @example\n* var v = pow( 5.0, NaN );\n* // returns NaN\n*\n* @example\n* var v = pow( NaN, NaN );\n* // returns NaN\n*/\nfunction pow( x, y ) {\n\tvar ahx; // absolute value high word `x`\n\tvar ahy; // absolute value high word `y`\n\tvar ax; // absolute value `x`\n\tvar hx; // high word `x`\n\tvar lx; // low word `x`\n\tvar hy; // high word `y`\n\tvar ly; // low word `y`\n\tvar sx; // sign `x`\n\tvar sy; // sign `y`\n\tvar y1;\n\tvar hp;\n\tvar lp;\n\tvar t;\n\tvar z; // y prime\n\tvar j;\n\tvar i;\n\tif ( isnan( x ) || isnan( y ) ) {\n\t\treturn NaN;\n\t}\n\t// Split `y` into high and low words:\n\ttoWords.assign( y, WORDS, 1, 0 );\n\thy = WORDS[ 0 ];\n\tly = WORDS[ 1 ];\n\n\t// Special cases `y`...\n\tif ( ly === 0 ) {\n\t\tif ( y === 0.0 ) {\n\t\t\treturn 1.0;\n\t\t}\n\t\tif ( y === 1.0 ) {\n\t\t\treturn x;\n\t\t}\n\t\tif ( y === -1.0 ) {\n\t\t\treturn 1.0 / x;\n\t\t}\n\t\tif ( y === 0.5 ) {\n\t\t\treturn sqrt( x );\n\t\t}\n\t\tif ( y === -0.5 ) {\n\t\t\treturn 1.0 / sqrt( x );\n\t\t}\n\t\tif ( y === 2.0 ) {\n\t\t\treturn x * x;\n\t\t}\n\t\tif ( y === 3.0 ) {\n\t\t\treturn x * x * x;\n\t\t}\n\t\tif ( y === 4.0 ) {\n\t\t\tx *= x;\n\t\t\treturn x * x;\n\t\t}\n\t\tif ( isInfinite( y ) ) {\n\t\t\treturn yIsInfinite( x, y );\n\t\t}\n\t}\n\t// Split `x` into high and low words:\n\ttoWords.assign( x, WORDS, 1, 0 );\n\thx = WORDS[ 0 ];\n\tlx = WORDS[ 1 ];\n\n\t// Special cases `x`...\n\tif ( lx === 0 ) {\n\t\tif ( hx === 0 ) {\n\t\t\treturn xIsZero( x, y );\n\t\t}\n\t\tif ( x === 1.0 ) {\n\t\t\treturn 1.0;\n\t\t}\n\t\tif (\n\t\t\tx === -1.0 &&\n\t\t\tisOdd( y )\n\t\t) {\n\t\t\treturn -1.0;\n\t\t}\n\t\tif ( isInfinite( x ) ) {\n\t\t\tif ( x === NINF ) {\n\t\t\t\t// `pow( 1/x, -y )`\n\t\t\t\treturn pow( -0.0, -y );\n\t\t\t}\n\t\t\tif ( y < 0.0 ) {\n\t\t\t\treturn 0.0;\n\t\t\t}\n\t\t\treturn PINF;\n\t\t}\n\t}\n\tif (\n\t\tx < 0.0 &&\n\t\tisInteger( y ) === false\n\t) {\n\t\t// Signal NaN...\n\t\treturn (x-x)/(x-x);\n\t}\n\tax = abs( x );\n\n\t// Remove the sign bits (i.e., get absolute values):\n\tahx = (hx & ABS_MASK)|0; // asm type annotation\n\tahy = (hy & ABS_MASK)|0; // asm type annotation\n\n\t// Extract the sign bits:\n\tsx = (hx >>> HIGH_NUM_NONSIGN_BITS)|0; // asm type annotation\n\tsy = (hy >>> HIGH_NUM_NONSIGN_BITS)|0; // asm type annotation\n\n\t// Determine the sign of the result...\n\tif ( sx && isOdd( y ) ) {\n\t\tsx = -1.0;\n\t} else {\n\t\tsx = 1.0;\n\t}\n\t// Case 1: `|y|` is huge...\n\n\t// |y| > 2^31\n\tif ( ahy > HIGH_BIASED_EXP_31 ) {\n\t\t// `|y| > 2^64`, then must over- or underflow...\n\t\tif ( ahy > HIGH_BIASED_EXP_64 ) {\n\t\t\treturn yIsHuge( x, y );\n\t\t}\n\t\t// Over- or underflow if `x` is not close to unity...\n\n\t\tif ( ahx < HIGH_MAX_NEAR_UNITY ) {\n\t\t\t// y < 0\n\t\t\tif ( sy === 1 ) {\n\t\t\t\t// Signal overflow...\n\t\t\t\treturn sx * HUGE * HUGE;\n\t\t\t}\n\t\t\t// Signal underflow...\n\t\t\treturn sx * TINY * TINY;\n\t\t}\n\t\tif ( ahx > HIGH_BIASED_EXP_0 ) {\n\t\t\t// y > 0\n\t\t\tif ( sy === 0 ) {\n\t\t\t\t// Signal overflow...\n\t\t\t\treturn sx * HUGE * HUGE;\n\t\t\t}\n\t\t\t// Signal underflow...\n\t\t\treturn sx * TINY * TINY;\n\t\t}\n\t\t// At this point, `|1-x|` is tiny (`<= 2^-20`). Suffice to compute `log(x)` by `x - x^2/2 + x^3/3 - x^4/4`.\n\t\tt = logx( LOG_WORKSPACE, ax );\n\t}\n\t// Case 2: `|y|` is not huge...\n\telse {\n\t\tt = log2ax( LOG_WORKSPACE, ax, ahx );\n\t}\n\t// Split `y` into `y1 + y2` and compute `(y1+y2) * (t1+t2)`...\n\ty1 = setLowWord( y, 0 );\n\tlp = ( (y-y1)*t[0] ) + ( y*t[1] );\n\thp = y1 * t[0];\n\tz = lp + hp;\n\n\t// Note: *can* be more performant to use `getHighWord` and `getLowWord` directly, but using `toWords` looks cleaner.\n\ttoWords.assign( z, WORDS, 1, 0 );\n\tj = uint32ToInt32( WORDS[0] );\n\ti = uint32ToInt32( WORDS[1] );\n\n\t// z >= 1024\n\tif ( j >= HIGH_BIASED_EXP_10 ) {\n\t\t// z > 1024\n\t\tif ( ((j-HIGH_BIASED_EXP_10)|i) !== 0 ) {\n\t\t\t// Signal overflow...\n\t\t\treturn sx * HUGE * HUGE;\n\t\t}\n\t\tif ( (lp+OVT) > (z-hp) ) {\n\t\t\t// Signal overflow...\n\t\t\treturn sx * HUGE * HUGE;\n\t\t}\n\t}\n\t// z <= -1075\n\telse if ( (j&ABS_MASK) >= HIGH_1075 ) {\n\t\t// z < -1075\n\t\tif ( ((j-HIGH_NEG_1075)|i) !== 0 ) {\n\t\t\t// Signal underflow...\n\t\t\treturn sx * TINY * TINY;\n\t\t}\n\t\tif ( lp <= (z-hp) ) {\n\t\t\t// Signal underflow...\n\t\t\treturn sx * TINY * TINY;\n\t\t}\n\t}\n\t// Compute `2^(hp+lp)`...\n\tz = pow2( j, hp, lp );\n\n\treturn sx * z;\n}\n\n\n// EXPORTS //\n\nexport default pow;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport abs from '@stdlib/math-base-special-abs';\nimport PINF from '@stdlib/constants-float64-pinf';\n\n\n// MAIN //\n\n/**\n* Evaluates the exponential function when \\\\( y = \\pm \\infty\\\\).\n*\n* @private\n* @param {number} x - base\n* @param {number} y - exponent\n* @returns {number} function value\n*\n* @example\n* var v = pow( -1.0, Infinity );\n* // returns NaN\n*\n* @example\n* var v = pow( -1.0, -Infinity );\n* // returns NaN\n*\n* @example\n* var v = pow( 1.0, Infinity );\n* // returns 1.0\n*\n* @example\n* var v = pow( 1.0, -Infinity );\n* // returns 1.0\n*\n* @example\n* var v = pow( 0.5, Infinity );\n* // returns 0.0\n*\n* @example\n* var v = pow( 0.5, -Infinity );\n* // returns Infinity\n*\n* @example\n* var v = pow( 1.5, -Infinity );\n* // returns 0.0\n*\n* @example\n* var v = pow( 1.5, Infinity );\n* // returns Infinity\n*/\nfunction pow( x, y ) {\n\tif ( x === -1.0 ) {\n\t\t// Julia (0.4.2) and Python (2.7.9) return `1.0` (WTF???). JavaScript (`Math.pow`), R, and libm return `NaN`. We choose `NaN`, as the value is indeterminate; i.e., we cannot determine whether `y` is odd, even, or somewhere in between.\n\t\treturn (x-x)/(x-x); // signal NaN\n\t}\n\tif ( x === 1.0 ) {\n\t\treturn 1.0;\n\t}\n\t// (|x| > 1 && y === NINF) || (|x| < 1 && y === PINF)\n\tif ( (abs(x) < 1.0) === (y === PINF) ) {\n\t\treturn 0.0;\n\t}\n\t// (|x| > 1 && y === PINF) || (|x| < 1 && y === NINF)\n\treturn PINF;\n}\n\n\n// EXPORTS //\n\nexport default pow;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isOdd from '@stdlib/math-base-assert-is-odd';\nimport copysign from '@stdlib/math-base-special-copysign';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport PINF from '@stdlib/constants-float64-pinf';\n\n\n// MAIN //\n\n/**\n* Evaluates the exponential function when \\\\(|x| = 0\\\\).\n*\n* @private\n* @param {number} x - base\n* @param {number} y - exponent\n* @returns {number} function value\n*\n* @example\n* var v = pow( 0.0, 2 );\n* // returns 0.0\n*\n* @example\n* var v = pow( -0.0, -9 );\n* // returns -Infinity\n*\n* @example\n* var v = pow( 0.0, -9 );\n* // returns Infinity\n*\n* @example\n* var v = pow( -0.0, 9 );\n* // returns 0.0\n*\n* @example\n* var v = pow( 0.0, -Infinity );\n* // returns Infinity\n*\n* @example\n* var v = pow( 0.0, Infinity );\n* // returns 0.0\n*/\nfunction pow( x, y ) {\n\tif ( y === NINF ) {\n\t\treturn PINF;\n\t}\n\tif ( y === PINF ) {\n\t\treturn 0.0;\n\t}\n\tif ( y > 0.0 ) {\n\t\tif ( isOdd( y ) ) {\n\t\t\treturn x; // handles +-0\n\t\t}\n\t\treturn 0.0;\n\t}\n\t// y < 0.0\n\tif ( isOdd( y ) ) {\n\t\treturn copysign( PINF, x ); // handles +-0\n\t}\n\treturn PINF;\n}\n\n\n// EXPORTS //\n\nexport default pow;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.5;\n\t}\n\treturn 0.5 + (x * (-0.3333333333333333 + (x * 0.25)));\n}\n\n\n// EXPORTS //\n\nexport default evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.5999999999999946;\n\t}\n\treturn 0.5999999999999946 + (x * (0.4285714285785502 + (x * (0.33333332981837743 + (x * (0.272728123808534 + (x * (0.23066074577556175 + (x * 0.20697501780033842))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.16666666666666602;\n\t}\n\treturn 0.16666666666666602 + (x * (-0.0027777777777015593 + (x * (0.00006613756321437934 + (x * (-0.0000016533902205465252 + (x * 4.1381367970572385e-8))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward positive infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = ceil( -4.2 );\n* // returns -4.0\n*\n* @example\n* var v = ceil( 9.99999 );\n* // returns 10.0\n*\n* @example\n* var v = ceil( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = ceil( NaN );\n* // returns NaN\n*/\nvar ceil = Math.ceil; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default ceil;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/12.2.0/lib/msun/src/e_log2.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getHighWord from '@stdlib/number-float64-base-get-high-word';\nimport setHighWord from '@stdlib/number-float64-base-set-high-word';\nimport setLowWord from '@stdlib/number-float64-base-set-low-word';\nimport toWords from '@stdlib/number-float64-base-to-words';\nimport isnan from '@stdlib/math-base-assert-is-nan';\nimport ABS_MASK from '@stdlib/constants-float64-high-word-abs-mask';\nimport HIGH_SIGNIFICAND_MASK from '@stdlib/constants-float64-high-word-significand-mask';\nimport BIAS from '@stdlib/constants-float64-exponent-bias';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport kernelLog1p from '@stdlib/math-base-special-kernel-log1p';\n\n\n// VARIABLES //\n\nvar TWO54 = 1.80143985094819840000e+16; // 0x43500000, 0x00000000\nvar IVLN2HI = 1.44269504072144627571e+00; // 0x3ff71547, 0x65200000\nvar IVLN2LO = 1.67517131648865118353e-10; // 0x3de705fc, 0x2eefa200\n\n// 0x7ff00000 = 2146435072 => 0 11111111111 00000000000000000000 => biased exponent: 2047 = 1023+1023 => 2^1023\nvar HIGH_MAX_NORMAL_EXP = 0x7ff00000|0; // asm type annotation\n\n// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022\nvar HIGH_MIN_NORMAL_EXP = 0x00100000|0; // asm type annotation\n\n// 0x3ff00000 = 1072693248 => 0 01111111111 00000000000000000000 => biased exponent: 1023 = 0+1023 => 2^0 = 1\nvar HIGH_BIASED_EXP_0 = 0x3ff00000|0; // asm type annotation\n\n// High/low words workspace:\nvar WORDS = [ 0|0, 0|0 ];\n\n\n// MAIN //\n\n/**\n* Evaluates the binary logarithm (base two).\n*\n* @param {NonNegativeNumber} x - input value\n* @returns {number} function value\n*\n* @example\n* var v = log2( 4.0 );\n* // returns 2.0\n*\n* @example\n* var v = log2( 8.0 );\n* // returns 3.0\n*\n* @example\n* var v = log2( 0.0 );\n* // returns -Infinity\n*\n* @example\n* var v = log2( Infinity );\n* // returns Infinity\n*\n* @example\n* var v = log2( NaN );\n* // returns NaN\n*\n* @example\n* var v = log2( -4.0 );\n* // returns NaN\n*/\nfunction log2( x ) {\n\tvar valHi;\n\tvar valLo;\n\tvar hfsq;\n\tvar hx;\n\tvar lx;\n\tvar hi;\n\tvar lo;\n\tvar f;\n\tvar R;\n\tvar w;\n\tvar y;\n\tvar i;\n\tvar k;\n\n\tif ( isnan( x ) || x < 0.0 ) {\n\t\treturn NaN;\n\t}\n\ttoWords.assign( x, WORDS, 1, 0 );\n\thx = WORDS[ 0 ];\n\tlx = WORDS[ 1 ];\n\tk = 0|0; // asm type annotation\n\tif ( hx < HIGH_MIN_NORMAL_EXP ) {\n\t\t// Case: x < 2**-1022\n\t\tif ( ( (hx&ABS_MASK) | lx ) === 0 ) {\n\t\t\treturn NINF;\n\t\t}\n\t\tk -= 54|0; // asm type annotation\n\n\t\t// Subnormal number, scale up x:\n\t\tx *= TWO54;\n\t\thx = getHighWord( x );\n\t}\n\tif ( hx >= HIGH_MAX_NORMAL_EXP ) {\n\t\treturn x + x;\n\t}\n\t// Case: log(1) = +0\n\tif ( hx === HIGH_BIASED_EXP_0 && lx === 0 ) {\n\t\treturn 0.0;\n\t}\n\tk += ( (hx>>20) - BIAS )|0; // asm type annotation\n\thx &= HIGH_SIGNIFICAND_MASK;\n\ti = ( ( hx+0x95f64 ) & HIGH_MIN_NORMAL_EXP )|0; // asm type annotation\n\n\t// Normalize x or x/2...\n\tx = setHighWord( x, hx|(i^HIGH_BIASED_EXP_0) );\n\tk += (i>>20)|0; // asm type annotation\n\ty = k;\n\tf = x - 1.0;\n\thfsq = 0.5 * f * f;\n\tR = kernelLog1p( f );\n\n\t/*\n\t* Notes:\n\t*\n\t* - `f-hfsq` must (for args near `1`) be evaluated in extra precision to avoid a large cancellation when `x` is near `sqrt(2)` or `1/sqrt(2)`.This is fairly efficient since `f-hfsq` only depends on `f`, so can be evaluated in parallel with `R`. Not combining `hfsq` with `R` also keeps `R` small (though not as small as a true `lo` term would be), so that extra precision is not needed for terms involving `R`.\n\t* - When implemented in C, compiler bugs involving extra precision used to break Dekker's theorem for spitting `f-hfsq` as `hi+lo`. These problems are now automatically avoided as a side effect of the optimization of combining the Dekker splitting step with the clear-low-bits step.\n\t* - `y` must (for args near `sqrt(2)` and `1/sqrt(2)`) be added in extra precision to avoid a very large cancellation when `x` is very near these values. Unlike the above cancellations, this problem is specific to base `2`. It is strange that adding `+-1` is so much harder than adding `+-ln2` or `+-log10_2`.\n\t* - This implementation uses Dekker's theorem to normalize `y+val_hi`, so, when implemented in C, compiler bugs may reappear in some configurations.\n\t* - The multi-precision calculations for the multiplications are routine.\n\t*/\n\thi = f - hfsq;\n\thi = setLowWord( hi, 0 );\n\tlo = ( f - hi ) - hfsq + R;\n\tvalHi = hi * IVLN2HI;\n\tvalLo = ( ( lo + hi ) * IVLN2LO ) + ( lo * IVLN2HI );\n\n\tw = y + valHi;\n\tvalLo += ( y - w ) + valHi;\n\tvalHi = w;\n\n\treturn valLo + valHi;\n}\n\n\n// EXPORTS //\n\nexport default log2;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isnan from '@stdlib/math-base-assert-is-nan';\nimport isInfinite from '@stdlib/math-base-assert-is-infinite';\nimport pow from '@stdlib/math-base-special-pow';\nimport floor from '@stdlib/math-base-special-floor';\nimport ceil from '@stdlib/math-base-special-ceil';\nimport log2 from '@stdlib/math-base-special-log2';\nimport MAX_EXP from '@stdlib/constants-float64-max-base2-exponent';\nimport MIN_EXP_SUBNORMAL from '@stdlib/constants-float64-min-base2-exponent-subnormal';\nimport PINF from '@stdlib/constants-float64-pinf';\n\n\n// MAIN //\n\n/**\n* Rounds a numeric value to the nearest power of two toward positive infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = ceil2( 3.141592653589793 );\n* // returns 4.0\n*\n* @example\n* var v = ceil2( 9.0 );\n* // returns 16.0\n*\n* @example\n* var v = ceil2( -0.314 );\n* // returns -0.25\n*/\nfunction ceil2( x ) {\n\tvar sign;\n\tvar p;\n\tif (\n\t\tisnan( x ) ||\n\t\tisInfinite( x ) ||\n\t\tx === 0.0\n\t) {\n\t\treturn x;\n\t}\n\tif ( x < 0 ) {\n\t\tx = -x;\n\t\tsign = -1.0;\n\t} else {\n\t\tsign = 1.0;\n\t}\n\t// Solve the equation `2^p = x` for `p`:\n\tp = log2( x );\n\n\t// If provided the smallest subnormal, no rounding possible:\n\tif ( p === MIN_EXP_SUBNORMAL ) {\n\t\treturn x;\n\t}\n\t// Determine a power of two which rounds the input value toward positive infinity:\n\tif ( sign === -1.0 ) {\n\t\tp = floor( p );\n\t} else {\n\t\tp = ceil( p );\n\t}\n\t// Handle overflow:\n\tif ( p > MAX_EXP ) {\n\t\treturn PINF;\n\t}\n\treturn sign * pow( 2.0, p );\n}\n\n\n// EXPORTS //\n\nexport default ceil2;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/12.2.0/lib/msun/src/k_log.h}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nimport polyvalP from './polyval_p.js';\nimport polyvalQ from './polyval_q.js';\n\n\n// MAIN //\n\n/**\n* Computes `log(1+f) - f` for `1+f` in `~[sqrt(2)/2, sqrt(2)]`.\n*\n* ## Method\n*\n* This function is a helper function for computing logarithms in base \\\\(e\\\\), and what follows describes the overall strategy for doing so. The argument reduction and adding the final term of the polynomial are done by the caller for increased accuracy when different bases are used.\n*\n* 1. Argument Reduction. Find \\\\(k\\\\) and \\\\(f\\\\) such that\n*\n* ```tex\n* x = 2^k \\cdot (1+f)\n* ```\n*\n* where \\\\(\\sqrt(2)/2 < 1+f < \\sqrt(2)\\\\).\n*\n* 2. Approximation of \\\\(\\operatorname{log}(1+f)\\\\). Let\n*\n* ```tex\n* \\begin{align*}\n* s &= \\frac{f}{2+f} \\\\\n* &= 2s + \\frac{2}{3} s^3 + \\frac{2}{5} s^5 + \\ldots \\\\\n* &= 2s + s R\n* \\end{align*}\n* ```\n*\n* based on\n*\n* ```tex\n* \\operatorname{log}(1+f) &= \\operatorname{log}(1+s) - \\operatorname{log}(1-s)\n* ```\n*\n* We use a special Reme algorithm on \\\\(\\[0,0.1716]\\\\) to generate a polynomial of degree \\\\(14\\\\) to approximate \\\\(R\\\\). The maximum error of this polynomial approximation is bounded by \\\\(2^{-58.45}\\\\). In other words,\n*\n* ```tex\n* R(z) ~ L_{g1} s^2 + L_{g2} s^4 + L_{g3} s^6 + L_{g4} s^8 + L_{g5} s^{10} + L_{g6} s^{12} + L_{g7} s^{14}\n* ```\n*\n* where the values of \\\\(L_{g1}\\\\) to \\\\(L_{g7}\\\\) are the polynomial coefficients used in the program below and\n*\n* ```tex\n* L_{g1} s^2 + \\ldots + L_{g7} s^{14} - R(z) \\leq 2^{-58.45}\n* ```\n*\n* Note that\n*\n* ```tex\n* 2s = f - s \\cdot f = f - h_{fsq} + (s \\cdot h_{fsq})\n* ```\n*\n* where \\\\(h_{fsq} = f^{2}/2\\\\).\n*\n* In order to guarantee an error in \\\\(\\operatorname{log}\\\\) below 1 ulp, we compute \\\\(\\operatorname{log}\\\\) by\n*\n* ```tex\n* \\begin{align*}\n* \\operatorname{log}(1+f) &= f - s (f - R) & \\textrm{(if f is not too large)} \\\\\n* \\operatorname{log}(1+f) &= f - (h_{fsq} - s (h_{fsq}+R)) & \\textrm{(better accuracy)}\n* \\end{align*}\n*\n* 3. Finally,\n*\n* ```tex\n* \\begin{align*}\n* \\operatorname{log}(x) &= k \\cdot \\operatorname{ln2} + \\operatorname{log}(1+f) \\\\\n* &= k \\cdot \\operatorname{ln2}_{hi} + (f-(h_{fsq}-(s \\cdot (h_{fsq}+R) + k \\cdot \\operatorname{ln2}_{lo})))\n* \\end{align*}\n* ```\n*\n* Here, \\\\(\\operatorname{ln2}\\\\) is split into two floating point numbers:\n*\n* ```tex\n* \\operatorname{ln2} = \\operatorname{ln2}_{hi} + \\operatorname{ln2}_{lo}\n* ```\n*\n* where \\\\(n \\cdot \\operatorname{ln2}_{hi}\\\\) is always exact for \\\\(|n| < 2000\\\\).\n*\n* @param {number} f - input value\n* @returns {number} function value\n*\n* @example\n* var v = kernelLog1p( 1.0 );\n* // returns ~0.1931\n*\n* @example\n* var v = kernelLog1p( 1.4142135623730951 );\n* // returns ~0.4672\n*\n* @example\n* var v = kernelLog1p( NaN );\n* // returns NaN\n*/\nfunction kernelLog1p( f ) {\n\tvar hfsq;\n\tvar t1;\n\tvar t2;\n\tvar s;\n\tvar z;\n\tvar R;\n\tvar w;\n\n\ts = f / ( 2.0 + f );\n\tz = s * s;\n\tw = z * z;\n\tt1 = w * polyvalP( w );\n\tt2 = z * polyvalQ( w );\n\tR = t2 + t1;\n\thfsq = 0.5 * f * f;\n\treturn s * ( hfsq + R );\n}\n\n\n// EXPORTS //\n\nexport default kernelLog1p;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.3999999999940942;\n\t}\n\treturn 0.3999999999940942 + (x * (0.22222198432149784 + (x * 0.15313837699209373))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.6666666666666735;\n\t}\n\treturn 0.6666666666666735 + (x * (0.2857142874366239 + (x * (0.1818357216161805 + (x * 0.14798198605116586))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArray from '@stdlib/assert-is-array';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isTypedArrayLike from '@stdlib/assert-is-typed-array-like';\nimport isInteger from '@stdlib/assert-is-integer';\nimport format from '@stdlib/error-tools-fmtprodmsg';\nimport prependArray from './prepend_array.js';\nimport prependObject from './prepend_object.js';\nimport prependTypedArray from './prepend_typed_array.js';\n\n\n// MAIN //\n\n/**\n* Adds elements from one collection to the beginning of another collection.\n*\n* @param {Collection} collection1 - collection\n* @param {Collection} collection2 - collection containing elements to add\n* @throws {TypeError} first argument must be either an array, typed array, or an array-like object\n* @throws {TypeError} second argument must be an array-like object\n* @returns {Collection} updated collection\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( collection1, collection2 ) {\n\tif ( !isCollection( collection2 ) ) {\n\t\tthrow new TypeError( format( '1Wn2y', collection2 ) );\n\t}\n\tif ( isArray( collection1 ) ) {\n\t\treturn prependArray( collection1, collection2 );\n\t}\n\t// Check for a typed-array-like object, as verifying actual typed arrays is expensive...\n\tif ( isTypedArrayLike( collection1 ) ) {\n\t\treturn prependTypedArray( collection1, collection2 );\n\t}\n\t// Check for an array-like object...\n\tif (\n\t\tcollection1 !== null &&\n\t\ttypeof collection1 === 'object' &&\n\t\ttypeof collection1.length === 'number' &&\n\t\tisInteger( collection1.length ) &&\n\t\tcollection1.length >= 0\n\t) {\n\t\treturn prependObject( collection1, collection2 );\n\t}\n\tthrow new TypeError( format( '1WnAi', collection1 ) );\n}\n\n\n// EXPORTS //\n\nexport default prepend;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-array-max-typed-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a collection.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is a collection\n*\n* @example\n* var bool = isCollection( [] );\n* // returns true\n*\n* @example\n* var bool = isCollection( {} );\n* // returns false\n*/\nfunction isCollection( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isCollection;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of an array.\n*\n* @private\n* @param {Array} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {Array} input array\n*\n* @example\n* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( arr, items ) {\n\tvar i;\n\tfor ( i = items.length-1; i >= 0; i-- ) {\n\t\tarr.unshift( items[ i ] );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nexport default prepend;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport MAX from '@stdlib/constants-array-max-typed-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is typed-array-like.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is typed-array-like\n*\n* @example\n* var arr = {\n* 'BYTES_PER_ELEMENT': 8,\n* 'length': 10,\n* 'byteOffset': 0,\n* 'byteLength': 10\n* };\n* var val = isTypedArrayLike( arr );\n* // returns true\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var val = isTypedArrayLike( new Int8Array( 4 ) );\n* // returns true\n*\n* @example\n* var val = isTypedArrayLike( [] );\n* // returns false\n*\n* @example\n* var val = isTypedArrayLike( {} );\n* // returns false\n*\n* @example\n* var val = isTypedArrayLike( null );\n* // returns false\n*\n* @example\n* var val = isTypedArrayLike( 'beep' );\n* // returns false\n*/\nfunction isTypedArrayLike( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object' &&\n\t\tisNonNegativeInteger( value.length ) &&\n\t\tvalue.length <= MAX &&\n\t\ttypeof value.BYTES_PER_ELEMENT === 'number' &&\n\t\ttypeof value.byteOffset === 'number' &&\n\t\ttypeof value.byteLength === 'number'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isTypedArrayLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ArrayBuffer from '@stdlib/array-buffer';\nimport ceil2 from '@stdlib/math-base-special-ceil2'; // TODO: nextpow2\n\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of a typed array.\n*\n* ## Notes\n*\n* - If the underlying `ArrayBuffer` is too short, we need to copy the data to a new `ArrayBuffer`. To do so, we allocate a new `ArrayBuffer` in a manner similar to how `Arrays` are resized (i.e., allocate enough memory to hold `nextpow2(n)` elements).\n* - Beware that, if an ArrayBuffer view is preceded by one or more other views, the created view may contain elements from those views, thus resulting in possible mutation. Accordingly, providing a typed array view having a shared underlying `ArrayBuffer` may have unintended consequences (including security vulnerabilities).\n*\n* @private\n* @param {TypedArray} arr - input array\n* @param {ArrayLike} items - items to add\n* @returns {TypedArray} input array\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* arr = prepend( arr, [ 6.0, 7.0 ] );\n* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction prepend( arr, items ) {\n\tvar nbytes;\n\tvar ibytes;\n\tvar offset;\n\tvar total;\n\tvar len;\n\tvar buf;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tlen = arr.length;\n\tn = items.length;\n\n\tibytes = n * arr.BYTES_PER_ELEMENT;\n\toffset = arr.byteOffset;\n\n\tif ( offset < ibytes ) {\n\t\tnbytes = len * arr.BYTES_PER_ELEMENT;\n\t\ttotal = nbytes + ibytes + offset;\n\t\tbuf = new ArrayBuffer( ceil2( total+1 ) );\n\t\toffset = buf.byteLength - nbytes - ibytes;\n\t\tv = new arr.constructor( buf, offset, len+n );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tv[ i+n ] = arr[ i ];\n\t\t}\n\t} else {\n\t\toffset -= ibytes;\n\t\tv = new arr.constructor( arr.buffer, offset, len+n );\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tv[ i ] = items[ i ];\n\t}\n\treturn v;\n}\n\n\n// EXPORTS //\n\nexport default prepend;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds elements from a collection to the beginning of an array-like object.\n*\n* @private\n* @param {Object} obj - input array-like object\n* @param {ArrayLike} items - items to add\n* @returns {Object} input object\n*\n* @example\n* var obj = {\n* 'length': 2,\n* '0': 1.0,\n* '1': 2.0\n* };\n*\n* obj = prepend( obj, [ 3.0, 4.0 ] );\n* // returns { 'length': 4, '0': 3.0, '1': 4.0, '2': 1.0, '3': 2.0 }\n*/\nfunction prepend( obj, items ) {\n\tvar len;\n\tvar n;\n\tvar i;\n\n\tlen = obj.length;\n\tn = items.length;\n\n\t// Shift all existing elements to the right...\n\tfor ( i = len-1; i >= 0; i-- ) {\n\t\tobj[ i+n ] = obj[ i ];\n\t}\n\t// Add new elements...\n\tfor ( i = 0; i < n; i++ ) {\n\t\tobj[ i ] = items[ i ];\n\t}\n\tobj.length = len + n;\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nexport default prepend;\n"],"names":["FLG","Symbol","hasToStringTagSupport","toStringTag","toStr","Object","prototype","toString","has","hasOwnProperty","Sym","toStrTag","nativeClass","hasToStringTag","v","isOwn","tag","out","value","property","call","err","main$7","Array","isArray","floor","Math","isInteger","x","MAX_TYPED_ARRAY_LENGTH","main","defineProperty","isNumber","zeros","n","i","zeroPad","str","width","right","negative","pad","length","startsWithMinus","substr","lowercase","String","toLowerCase","uppercase","toUpperCase","formatInteger","token","base","specifier","arg","parseInt","isFinite","Error","precision","padRight","sign","alternate","charAt","abs","replace","RE_EXP_POS_DIGITS","RE_EXP_NEG_DIGITS","RE_ONLY_DIGITS","RE_DIGITS_BEFORE_EXP","RE_TRAILING_PERIOD_ZERO","RE_PERIOD_ZERO_EXP","RE_ZERO_BEFORE_EXP","formatDouble","digits","f","parseFloat","toExponential","toFixed","toPrecision","spaces","fromCharCode","isnan","initialize","flags","mapping","formatInterpolate","tokens","hasPeriod","flag","num","pos","j","TypeError","padZeros","indexOf","arguments","maxWidth","substring","RE","parse","match","formatTokenize","content","prev","exec","slice","lastIndex","push","format","args","tokenize","interpolate","apply","objectProtoype","defineGetter","__defineGetter__","defineSetter","__defineSetter__","lookupGetter","__lookupGetter__","lookupSetter","__lookupSetter__","defineProperty$1","hasDefinePropertySupport","builtin","obj","prop","descriptor","hasValue","hasGet","hasSet","__proto__","get","set","setNonEnumerableReadOnly","configurable","enumerable","writable","main$5","Number","test","isPrimitive","isObject","setReadOnly","FLOAT64_PINF","POSITIVE_INFINITY","FLOAT64_NINF","NEGATIVE_INFINITY","PINF","NINF","isInt","valueOf","isNonNegativeInteger","fmtprodmsg","a","u","encodeURIComponent","ctor","hasArrayBuffer","ArrayBuffer","hasFloat64Array","Float64Array","bool","arr","GlobalFloat64Array","NaN","hasFloat64ArraySupport","Float64Array$1","view","buf","GlobalArrayBuffer","isView","byteLength","hasArrayBufferSupport","ArrayBuffer$1","isInfinite","isEven","isOdd","sqrt","hasUint32Array","Uint32Array","GlobalUint32Array","UINT32_MAX","hasUint32ArraySupport","Uint32Array$1","hasUint8Array","Uint8Array","GlobalUint8Array","UINT8_MAX","hasUint8ArraySupport","Uint8Array$1","hasUint16Array","Uint16Array","GlobalUint16Array","UINT16_MAX","hasUint16ArraySupport","uint16view","ctors","uint16","uint8","HIGH","LOW","IS_LITTLE_ENDIAN","buffer","isLittleEndian","indices$3","FLOAT64_VIEW","UINT32_VIEW","indices","toWords","stride","offset","fcn","assign","LOW$3","setLowWord","low","uint32ToInt32","FLOAT64_HIGH_WORD_ABS_MASK","FLOAT64_HIGH_WORD_SIGN_MASK","HIGH$5","getHighWord","indices$1","fromWords","high","WORDS","copysign","y","hx","hy","ABS_MASK","SIGN_MASK","HIGH_MAX_NEAR_UNITY","HUGE","TINY","HIGH$1","setHighWord","FLOAT64_EXPONENT_BIAS","HIGH_SIGNIFICAND_MASK","HIGH_MIN_NORMAL_EXP","HIGH_BIASED_EXP_0","HIGH_BIASED_EXP_NEG_512","HIGH_SIGNIFICAND_HALF","HIGH_NUM_SIGNIFICAND_BITS","TWO53","CP","CP_HI","CP_LO","BP","DP_HI","DP_LO","INV_LN2","INV_LN2_HI","INV_LN2_LO","FLOAT64_MAX_BASE2_EXPONENT","FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL","FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL","FLOAT64_SMALLEST_NORMAL","SCALAR","normalize","FLOAT64_HIGH_WORD_EXPONENT_MASK","TWO52_INV","CLEAR_EXP_MASK","FRAC","ldexp","frac","exp","m","EXP_MASK","BIAS","floatExp","MIN_SUBNORMAL_EXPONENT","MAX_EXPONENT","MAX_SUBNORMAL_EXPONENT","LN2","FLOAT64_HIGH_WORD_SIGNIFICAND_MASK","HIGH_BIASED_EXP_NEG_1","LN2_HI","LN2_LO","HIGH_BIASED_EXP_31","HIGH_BIASED_EXP_64","HIGH_BIASED_EXP_10","HIGH_1075","HIGH_NEG_1075","HIGH_NUM_NONSIGN_BITS","OVT","LOG_WORKSPACE","pow","ahx","ahy","ax","sx","sy","y1","hp","lp","t","z","yIsInfinite","xIsZero","yIsHuge","t2","t1","w","logx","tmp","ss","s2","hs","ls","ht","bp","dp","hz","lz","r","k","log2ax","pow2","ceil","TWO54","IVLN2HI","IVLN2LO","HIGH_MAX_NORMAL_EXP","ceil2","p","valHi","valLo","hfsq","lx","hi","lo","R","s","polyvalQ","kernelLog1p","log2","MIN_EXP_SUBNORMAL","MAX_EXP","collection1","collection2","MAX_LENGTH","items","unshift","prependArray","MAX","BYTES_PER_ELEMENT","byteOffset","isTypedArrayLike","nbytes","ibytes","len","constructor","prependTypedArray","prependObject"],"mappings":";yCA2BA,IAAIA,ECMgB,mBAAXC,QACoB,iBAApBA,OAAQ,ODOjB,SAASC,IACR,OAASF,GAAqC,iBAAvBC,OAAOE,WAC/B,CErBA,IAAIC,EAAQC,OAAOC,UAAUC,SCAzBC,EAAMH,OAAOC,UAAUG,eCAvBC,EAA0B,mBAAXT,OAA0BA,YAAS,ECKlDU,EAA+B,mBAAXV,EAA0BA,EAAOE,YAAc,GCiCvES,EATKC,ICDL,SAAsBC,GACrB,IAAIC,EACAC,EACAC,EJHgBC,EAAOC,EIK3B,GAAKL,QACJ,OAAOV,EAAMgB,KAAMN,GAEpBE,EAAMF,EAAGX,GJRkBgB,EISJhB,EAAvBY,EJPCG,OAFmBA,EISAJ,IJFbN,EAAIY,KAAMF,EAAOC,GIKxB,IACCL,EAAGX,QAAgB,CACnB,CAAC,MAAQkB,GACT,OAAOjB,EAAMgB,KAAMN,EACnB,CAQD,OAPAG,EAAMb,EAAMgB,KAAMN,GAEbC,EACJD,EAAGX,GAAgBa,SAEZF,EAAGX,GAEJc,CACR,EC3BA,SAAsBH,GACrB,OAAOV,EAAMgB,KAAMN,EACpB,ECYAQ,EATKC,MAAMC,QACND,MAAMC,QARX,SAAkBN,GACjB,MAAkC,mBAAzBN,EAAaM,EACvB,ECJIO,EAAQC,KAAKD,MCHjB,SAASE,EAAWC,G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EAAIwL,YAECG,EAMb,IALAD,EAASE,EAAM5L,EAAIuL,kBAGnBvI,GADA1C,EAAM,IAAIV,GAAaqK,GADfyB,EAASC,EAAS3I,EACU,KACvBvC,WAAaiL,EAASC,EACnChV,EAAI,IAAIqJ,EAAI6L,YAAavL,EAAK0C,EAAQ4I,EAAI7T,GACpCC,EAAI,EAAGA,EAAI4T,EAAK5T,IACrBrB,EAAGqB,EAAED,GAAMiI,EAAKhI,QAGjBgL,GAAU2I,EACVhV,EAAI,IAAIqJ,EAAI6L,YAAa7L,EAAIwC,OAAQQ,EAAQ4I,EAAI7T,GAElD,IAAMC,EAAI,EAAGA,EAAID,EAAGC,IACnBrB,EAAGqB,GAAMmT,EAAOnT,GAEjB,OAAOrB,CACR,CJjBSmV,CAAmBd,EAAaC,GAGxC,GACiB,OAAhBD,GACuB,iBAAhBA,GACuB,iBAAvBA,EAAYzS,QACnBf,GAAWwT,EAAYzS,SACvByS,EAAYzS,QAAU,EAEtB,OKrCF,SAAkBmF,EAAKyN,GACtB,IAAIS,EACA7T,EACAC,EAMJ,IAJA4T,EAAMlO,EAAInF,OACVR,EAAIoT,EAAM5S,OAGJP,EAAI4T,EAAI,EAAG5T,GAAK,EAAGA,IACxB0F,EAAK1F,EAAED,GAAM2F,EAAK1F,GAGnB,IAAMA,EAAI,EAAGA,EAAID,EAAGC,IACnB0F,EAAK1F,GAAMmT,EAAOnT,GAGnB,OADA0F,EAAInF,OAASqT,EAAM7T,EACZ2F,CACR,CLmBSqO,CAAef,EAAaC,GAEpC,MAAM,IAAIxP,UAAWgB,GAAQ,QAASuO,GACvC","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134]}
\ No newline at end of file
diff --git a/lib/index.js b/lib/index.js
deleted file mode 100644
index 05faf85..0000000
--- a/lib/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-/**
-* Add the elements of one collection to the beginning of another collection.
-*
-* @module @stdlib/utils-prepend
-*
-* @example
-* var prepend = require( '@stdlib/utils-prepend' );
-* var Float64Array = require( '@stdlib/array-float64' );
-*
-* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
-*
-* arr = prepend( arr, [ 6.0, 7.0 ] );
-* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
-*
-* arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
-* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
-*
-* arr = prepend( arr, [ 6.0, 7.0 ] );
-* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
-*/
-
-// MODULES //
-
-var main = require( './main.js' );
-
-
-// EXPORTS //
-
-module.exports = main;
diff --git a/lib/main.js b/lib/main.js
deleted file mode 100644
index 1d8faba..0000000
--- a/lib/main.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var isArray = require( '@stdlib/assert-is-array' );
-var isCollection = require( '@stdlib/assert-is-collection' );
-var isTypedArrayLike = require( '@stdlib/assert-is-typed-array-like' );
-var isInteger = require( '@stdlib/assert-is-integer' );
-var format = require( '@stdlib/string-format' );
-var prependArray = require( './prepend_array.js' );
-var prependObject = require( './prepend_object.js' );
-var prependTypedArray = require( './prepend_typed_array.js' );
-
-
-// MAIN //
-
-/**
-* Adds elements from one collection to the beginning of another collection.
-*
-* @param {Collection} collection1 - collection
-* @param {Collection} collection2 - collection containing elements to add
-* @throws {TypeError} first argument must be either an array, typed array, or an array-like object
-* @throws {TypeError} second argument must be an array-like object
-* @returns {Collection} updated collection
-*
-* @example
-* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
-*
-* arr = prepend( arr, [ 6.0, 7.0 ] );
-* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
-*
-* @example
-* var Float64Array = require( '@stdlib/array-float64' );
-*
-* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
-* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
-*
-* arr = prepend( arr, [ 6.0, 7.0 ] );
-* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
-*/
-function prepend( collection1, collection2 ) {
- if ( !isCollection( collection2 ) ) {
- throw new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', collection2 ) );
- }
- if ( isArray( collection1 ) ) {
- return prependArray( collection1, collection2 );
- }
- // Check for a typed-array-like object, as verifying actual typed arrays is expensive...
- if ( isTypedArrayLike( collection1 ) ) {
- return prependTypedArray( collection1, collection2 );
- }
- // Check for an array-like object...
- if (
- collection1 !== null &&
- typeof collection1 === 'object' &&
- typeof collection1.length === 'number' &&
- isInteger( collection1.length ) &&
- collection1.length >= 0
- ) {
- return prependObject( collection1, collection2 );
- }
- throw new TypeError( format( 'invalid argument. First argument must be either an array, typed array, or an array-like object. Value: `%s`.', collection1 ) );
-}
-
-
-// EXPORTS //
-
-module.exports = prepend;
diff --git a/lib/prepend_array.js b/lib/prepend_array.js
deleted file mode 100644
index b65fc6f..0000000
--- a/lib/prepend_array.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MAIN //
-
-/**
-* Adds elements from a collection to the beginning of an array.
-*
-* @private
-* @param {Array} arr - input array
-* @param {ArrayLike} items - items to add
-* @returns {Array} input array
-*
-* @example
-* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
-*
-* arr = prepend( arr, [ 6.0, 7.0 ] );
-* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
-*/
-function prepend( arr, items ) {
- var i;
- for ( i = items.length-1; i >= 0; i-- ) {
- arr.unshift( items[ i ] );
- }
- return arr;
-}
-
-
-// EXPORTS //
-
-module.exports = prepend;
diff --git a/lib/prepend_object.js b/lib/prepend_object.js
deleted file mode 100644
index 950c490..0000000
--- a/lib/prepend_object.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MAIN //
-
-/**
-* Adds elements from a collection to the beginning of an array-like object.
-*
-* @private
-* @param {Object} obj - input array-like object
-* @param {ArrayLike} items - items to add
-* @returns {Object} input object
-*
-* @example
-* var obj = {
-* 'length': 2,
-* '0': 1.0,
-* '1': 2.0
-* };
-*
-* obj = prepend( obj, [ 3.0, 4.0 ] );
-* // returns { 'length': 4, '0': 3.0, '1': 4.0, '2': 1.0, '3': 2.0 }
-*/
-function prepend( obj, items ) {
- var len;
- var n;
- var i;
-
- len = obj.length;
- n = items.length;
-
- // Shift all existing elements to the right...
- for ( i = len-1; i >= 0; i-- ) {
- obj[ i+n ] = obj[ i ];
- }
- // Add new elements...
- for ( i = 0; i < n; i++ ) {
- obj[ i ] = items[ i ];
- }
- obj.length = len + n;
- return obj;
-}
-
-
-// EXPORTS //
-
-module.exports = prepend;
diff --git a/lib/prepend_typed_array.js b/lib/prepend_typed_array.js
deleted file mode 100644
index 3e88278..0000000
--- a/lib/prepend_typed_array.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var ArrayBuffer = require( '@stdlib/array-buffer' );
-var ceil2 = require( '@stdlib/math-base-special-ceil2' ); // TODO: nextpow2
-
-
-// MAIN //
-
-/**
-* Adds elements from a collection to the beginning of a typed array.
-*
-* ## Notes
-*
-* - If the underlying `ArrayBuffer` is too short, we need to copy the data to a new `ArrayBuffer`. To do so, we allocate a new `ArrayBuffer` in a manner similar to how `Arrays` are resized (i.e., allocate enough memory to hold `nextpow2(n)` elements).
-* - Beware that, if an ArrayBuffer view is preceded by one or more other views, the created view may contain elements from those views, thus resulting in possible mutation. Accordingly, providing a typed array view having a shared underlying `ArrayBuffer` may have unintended consequences (including security vulnerabilities).
-*
-* @private
-* @param {TypedArray} arr - input array
-* @param {ArrayLike} items - items to add
-* @returns {TypedArray} input array
-*
-* @example
-* var Float64Array = require( '@stdlib/array-float64' );
-*
-* var arr = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
-* // returns [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
-*
-* arr = prepend( arr, [ 6.0, 7.0 ] );
-* // returns [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
-*/
-function prepend( arr, items ) {
- var nbytes;
- var ibytes;
- var offset;
- var total;
- var len;
- var buf;
- var n;
- var v;
- var i;
-
- len = arr.length;
- n = items.length;
-
- ibytes = n * arr.BYTES_PER_ELEMENT;
- offset = arr.byteOffset;
-
- if ( offset < ibytes ) {
- nbytes = len * arr.BYTES_PER_ELEMENT;
- total = nbytes + ibytes + offset;
- buf = new ArrayBuffer( ceil2( total+1 ) );
- offset = buf.byteLength - nbytes - ibytes;
- v = new arr.constructor( buf, offset, len+n );
- for ( i = 0; i < len; i++ ) {
- v[ i+n ] = arr[ i ];
- }
- } else {
- offset -= ibytes;
- v = new arr.constructor( arr.buffer, offset, len+n );
- }
- for ( i = 0; i < n; i++ ) {
- v[ i ] = items[ i ];
- }
- return v;
-}
-
-
-// EXPORTS //
-
-module.exports = prepend;
diff --git a/package.json b/package.json
index 2af97a3..7d30d06 100644
--- a/package.json
+++ b/package.json
@@ -3,31 +3,7 @@
"version": "0.2.2",
"description": "Add elements from one collection to the beginning of another collection.",
"license": "Apache-2.0",
- "author": {
- "name": "The Stdlib Authors",
- "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
- },
- "contributors": [
- {
- "name": "The Stdlib Authors",
- "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
- }
- ],
- "main": "./lib",
- "directories": {
- "benchmark": "./benchmark",
- "doc": "./docs",
- "example": "./examples",
- "lib": "./lib",
- "test": "./test"
- },
- "types": "./docs/types",
- "scripts": {
- "test": "make test",
- "test-cov": "make test-cov",
- "examples": "make examples",
- "benchmark": "make benchmark"
- },
+ "main": "./index.js",
"homepage": "https://stdlib.io",
"repository": {
"type": "git",
@@ -36,53 +12,6 @@
"bugs": {
"url": "https://github.com/stdlib-js/stdlib/issues"
},
- "dependencies": {
- "@stdlib/array-buffer": "^0.2.2",
- "@stdlib/assert-is-array": "^0.2.2",
- "@stdlib/assert-is-collection": "^0.2.2",
- "@stdlib/assert-is-integer": "^0.2.2",
- "@stdlib/assert-is-typed-array-like": "^0.2.2",
- "@stdlib/math-base-special-ceil2": "^0.3.0",
- "@stdlib/string-format": "^0.2.2",
- "@stdlib/types": "^0.4.3",
- "@stdlib/error-tools-fmtprodmsg": "^0.2.2"
- },
- "devDependencies": {
- "@stdlib/array-float32": "^0.2.2",
- "@stdlib/array-float64": "^0.2.2",
- "@stdlib/array-int16": "^0.2.2",
- "@stdlib/array-int32": "^0.2.2",
- "@stdlib/array-int8": "^0.2.2",
- "@stdlib/array-uint16": "^0.2.2",
- "@stdlib/array-uint32": "^0.2.2",
- "@stdlib/array-uint8": "^0.2.2",
- "@stdlib/array-uint8c": "^0.2.2",
- "@stdlib/constants-int16-max": "^0.2.2",
- "@stdlib/constants-int32-max": "^0.3.0",
- "@stdlib/constants-int8-max": "^0.2.2",
- "@stdlib/constants-uint16-max": "^0.2.2",
- "@stdlib/constants-uint32-max": "^0.2.2",
- "@stdlib/constants-uint8-max": "^0.2.2",
- "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
- "istanbul": "^0.4.1",
- "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
- "@stdlib/bench-harness": "^0.2.2"
- },
- "engines": {
- "node": ">=0.10.0",
- "npm": ">2.7.0"
- },
- "os": [
- "aix",
- "darwin",
- "freebsd",
- "linux",
- "macos",
- "openbsd",
- "sunos",
- "win32",
- "windows"
- ],
"keywords": [
"stdlib",
"stdutils",
diff --git a/stats_browser.html b/stats_browser.html
new file mode 100644
index 0000000..828e7f4
--- /dev/null
+++ b/stats_browser.html
@@ -0,0 +1,4842 @@
+
+
+
+
+
+
+
+ Rollup Visualizer
+
+
+
+
+
+
+
+
+
diff --git a/stats_node.html b/stats_node.html
new file mode 100644
index 0000000..35f57c6
--- /dev/null
+++ b/stats_node.html
@@ -0,0 +1,4842 @@
+
+
+
+
+
+
+
+ Rollup Visualizer
+
+
+
+
+
+
+
+
+
diff --git a/test/dist/test.js b/test/dist/test.js
deleted file mode 100644
index a8a9c60..0000000
--- a/test/dist/test.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2023 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var tape = require( 'tape' );
-var main = require( './../../dist' );
-
-
-// TESTS //
-
-tape( 'main export is defined', function test( t ) {
- t.ok( true, __filename );
- t.strictEqual( main !== void 0, true, 'main export is defined' );
- t.end();
-});
diff --git a/test/test.js b/test/test.js
deleted file mode 100644
index f4c16b9..0000000
--- a/test/test.js
+++ /dev/null
@@ -1,357 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-/* eslint-disable object-curly-newline */
-
-'use strict';
-
-// MODULES //
-
-var tape = require( 'tape' );
-var Float64Array = require( '@stdlib/array-float64' );
-var ArrayBuffer = require( '@stdlib/array-buffer' );
-var prepend = require( './../lib' );
-
-
-// TESTS //
-
-tape( 'main export is a function', function test( t ) {
- t.ok( true, __filename );
- t.strictEqual( typeof prepend, 'function', 'main export is a function' );
- t.end();
-});
-
-tape( 'the function throws an error if not provided either an array, typed array, or an array-like object', function test( t ) {
- var values;
- var i;
-
- values = [
- '5',
- 5,
- NaN,
- true,
- false,
- null,
- void 0,
- function noop() {},
- new Date(),
- new RegExp( '.+' ), // eslint-disable-line prefer-regex-literals
- {},
- { 'length': null },
- { 'length': -1 },
- { 'length': 3.14 }
- ];
-
- for ( i = 0; i < values.length; i++ ) {
- t.throws( badValue( values[ i ] ), TypeError, 'throws a type error when provided '+values[i] );
- }
- t.end();
-
- function badValue( value ) {
- return function badValue() {
- prepend( value, [ 1.0 ] );
- };
- }
-});
-
-tape( 'the function throws an error if not provided an array-like object', function test( t ) {
- var values;
- var i;
-
- values = [
- // '5', // this is considered array-like
- 5,
- NaN,
- true,
- false,
- null,
- void 0,
- function noop() {},
- new Date(),
- new RegExp( '.+' ), // eslint-disable-line prefer-regex-literals
- {},
- { 'length': null },
- { 'length': -1 },
- { 'length': 3.14 }
- ];
-
- for ( i = 0; i < values.length; i++ ) {
- t.throws( badValue( values[ i ] ), TypeError, 'throws a type error when provided '+values[i] );
- }
- t.end();
-
- function badValue( value ) {
- return function badValue() {
- prepend( [ 1.0, 2.0 ], value );
- };
- }
-});
-
-tape( 'the function adds the elements of a collection to an array', function test( t ) {
- var expected;
- var arr;
- var out;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
- out = prepend( arr, [ 6.0 ] );
-
- t.strictEqual( out, arr, 'returns input array' );
-
- expected = [ 6.0, 1.0, 2.0, 3.0, 4.0, 5.0 ];
- t.deepEqual( arr, expected, 'deep equal' );
-
- out = prepend( arr, [ 7.0, 8.0 ] );
-
- expected = [ 7.0, 8.0, 6.0, 1.0, 2.0, 3.0, 4.0, 5.0 ];
- t.deepEqual( arr, expected, 'deep equal' );
-
- t.end();
-});
-
-tape( 'the function adds the elements of a collection to an array-like object', function test( t ) {
- var expected;
- var arr;
- var out;
-
- arr = {
- 'length': 0
- };
- out = prepend( arr, [ 1.0 ] );
-
- t.strictEqual( out, arr, 'returns input collection' );
-
- expected = {
- 'length': 1,
- '0': 1.0
- };
- t.deepEqual( arr, expected, 'deep equal' );
-
- out = prepend( arr, [ 2.0, 3.0 ] );
-
- expected = {
- 'length': 3,
- '0': 2.0,
- '1': 3.0,
- '2': 1.0
- };
- t.deepEqual( arr, expected, 'deep equal' );
-
- t.end();
-});
-
-tape( 'the function adds elements from a collection to a typed array', function test( t ) {
- var expected;
- var arr;
- var out;
- var i;
-
- arr = new Float64Array();
- out = prepend( arr, [ 1.0 ] );
-
- t.notEqual( out, arr, 'does not return input array (new view)' );
-
- expected = new Float64Array( [ 1.0 ] );
- for ( i = 0; i < expected.length; i++ ) {
- t.strictEqual( out[ i ], expected[ i ], 'has expected value for element '+i );
- }
-
- out = prepend( out, [ 2.0, 3.0, 4.0 ] );
-
- expected = new Float64Array( [ 2.0, 3.0, 4.0, 1.0 ] );
- for ( i = 0; i < expected.length; i++ ) {
- t.strictEqual( out[ i ], expected[ i ], 'has expected value for element '+i );
- }
- // eslint-disable-next-line max-len
- out = prepend( out, [ 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0 ] );
-
- expected = new Float64Array([
- 5.0,
- 6.0,
- 7.0,
- 8.0,
- 9.0,
- 10.0,
- 11.0,
- 12.0,
- 13.0,
- 14.0,
- 2.0,
- 3.0,
- 4.0,
- 1.0
- ]);
- for ( i = 0; i < expected.length; i++ ) {
- t.strictEqual( out[ i ], expected[ i ], 'has expected value for element '+i );
- }
-
- t.end();
-});
-
-tape( 'the function adds elements from a collection to a typed array (preallocated buffer)', function test( t ) {
- var expected;
- var buf;
- var arr;
- var out;
- var i;
-
- buf = new ArrayBuffer( 64000 );
- arr = new Float64Array( buf, buf.byteLength, 0 );
- out = prepend( arr, [ 1.0 ] );
-
- t.notEqual( out, arr, 'does not return input array (new view)' );
-
- expected = new Float64Array( [ 1.0 ] );
- for ( i = 0; i < expected.length; i++ ) {
- t.strictEqual( out[ i ], expected[ i ], 'has expected value for element '+i );
- }
- t.strictEqual( out.buffer, arr.buffer, 'same underlying buffer' );
-
- out = prepend( out, [ 2.0, 3.0, 4.0 ] );
-
- expected = new Float64Array( [ 2.0, 3.0, 4.0, 1.0 ] );
- for ( i = 0; i < expected.length; i++ ) {
- t.strictEqual( out[ i ], expected[ i ], 'has expected value for element '+i );
- }
- t.strictEqual( out.buffer, arr.buffer, 'same underlying buffer' );
-
- // eslint-disable-next-line max-len
- out = prepend( out, [ 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0 ] );
-
- expected = new Float64Array([
- 5.0,
- 6.0,
- 7.0,
- 8.0,
- 9.0,
- 10.0,
- 11.0,
- 12.0,
- 13.0,
- 14.0,
- 2.0,
- 3.0,
- 4.0,
- 1.0
- ]);
- for ( i = 0; i < expected.length; i++ ) {
- t.strictEqual( out[ i ], expected[ i ], 'has expected value for element '+i );
- }
- t.strictEqual( out.buffer, arr.buffer, 'same underlying buffer' );
-
- t.end();
-});
-
-tape( 'the function adds one or more elements to a typed array (offset view)', function test( t ) {
- var expected;
- var arr;
- var buf;
- var out;
- var i;
-
- buf = new ArrayBuffer( 32 );
- arr = new Float64Array( buf, 3*8, 0 ); // 8 bytes per double
- out = prepend( arr, [ 1.0 ] );
-
- t.notEqual( out, arr, 'does not return input array (new view)' );
-
- expected = new Float64Array( [ 1.0 ] );
- for ( i = 0; i < expected.length; i++ ) {
- t.strictEqual( out[ i ], expected[ i ], 'has expected value for element '+i );
- }
- t.strictEqual( out.buffer, arr.buffer, 'same underlying buffer' );
-
- out = prepend( out, [ 2.0, 3.0, 4.0 ] );
-
- expected = new Float64Array( [ 2.0, 3.0, 4.0, 1.0 ] );
- for ( i = 0; i < expected.length; i++ ) {
- t.strictEqual( out[ i ], expected[ i ], 'has expected value for element '+i );
- }
- t.notEqual( out.buffer, arr.buffer, 'new underlying buffer' );
-
- // eslint-disable-next-line max-len
- out = prepend( out, [ 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0 ] );
-
- expected = new Float64Array([
- 5.0,
- 6.0,
- 7.0,
- 8.0,
- 9.0,
- 10.0,
- 11.0,
- 12.0,
- 13.0,
- 14.0,
- 2.0,
- 3.0,
- 4.0,
- 1.0
- ]);
- for ( i = 0; i < expected.length; i++ ) {
- t.strictEqual( out[ i ], expected[ i ], 'has expected value for element '+i );
- }
- t.notEqual( out.buffer, arr.buffer, 'new underlying buffer' );
-
- t.end();
-});
-
-tape( 'the function adds elements from a collection to a typed array (shared `ArrayBuffer`)', function test( t ) {
- var expected;
- var arr1;
- var arr2;
- var arr3;
- var buf;
- var out;
- var i;
-
- buf = new ArrayBuffer( 64 );
-
- arr1 = new Float64Array( buf, 2*8, 2 ); // 8 bytes per double
- arr2 = new Float64Array( buf, 4*8, 2 );
- arr3 = new Float64Array( buf, 6*8, 0 );
-
- arr1[ 0 ] = 3.14;
- arr1[ 1 ] = 6.28;
-
- arr2[ 0 ] = -3.14;
- arr2[ 1 ] = -6.28;
-
- out = prepend( arr3, [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
-
- t.notEqual( out, arr3, 'does not return input array (new view)' );
-
- expected = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- for ( i = 0; i < expected.length; i++ ) {
- t.strictEqual( out[ i ], expected[ i ], 'has expected value for element '+i );
- }
- t.strictEqual( out.buffer, arr3.buffer, 'same underlying buffer' );
-
- expected = new Float64Array( [ 5.0, 6.0 ] );
- for ( i = 0; i < expected.length; i++ ) {
- t.strictEqual( arr2[ i ], expected[ i ], 'value was overwritten for element '+i );
- }
- t.strictEqual( out.buffer, arr2.buffer, 'same underlying buffer' );
-
- expected = new Float64Array( [ 3.0, 4.0 ] );
- for ( i = 0; i < expected.length; i++ ) {
- t.strictEqual( arr1[ i ], expected[ i ], 'value was overwritten for element '+i );
- }
- t.strictEqual( out.buffer, arr1.buffer, 'same underlying buffer' );
-
- t.end();
-});