3.10.114 • Published 11 months ago

@devtea2026/nihil-iusto-possimus-consequatur v3.10.114

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Typed Arrays

NPM version Build Status Coverage Status

Create a typed array.

Installation

npm install @devtea2026/nihil-iusto-possimus-consequatur

Alternatively,

  • To load the package in a website via a script tag without installation and bundlers, use the ES Module available on the esm branch (see README).
  • If you are using Deno, visit the deno branch (see README for usage intructions).
  • For use in Observable, or in browser/node environments, use the Universal Module Definition (UMD) build available on the umd branch (see README).

The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.

To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.

Usage

var typedarray = require( '@devtea2026/nihil-iusto-possimus-consequatur' );

typedarray( [dtype] )

Creates a typed array having a specified data type dtype.

var arr = typedarray();
// returns <Float64Array>

The function recognizes the following data types:

  • float64: double-precision floating-point numbers (IEEE 754)
  • float32: single-precision floating-point numbers (IEEE 754)
  • complex128: double-precision complex floating-point numbers
  • complex64: single-precision complex floating-point numbers
  • int32: 32-bit two's complement signed integers
  • uint32: 32-bit unsigned integers
  • int16: 16-bit two's complement signed integers
  • uint16: 16-bit unsigned integers
  • int8: 8-bit two's complement signed integers
  • uint8: 8-bit unsigned integers
  • uint8c: 8-bit unsigned integers clamped to 0-255

By default, the output typed array data type is float64. To specify an alternative data type, provide a dtype argument.

var arr = typedarray( 'int32' );
// returns <Int32Array>

typedarray( length[, dtype] )

Returns a typed array having a specified length.

var arr1 = typedarray( 5 );
// returns <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]

var arr2 = typedarray( 5, 'uint8' );
// returns <Uint8Array>[ 0, 0, 0, 0, 0 ]

typedarray( typedarray[, dtype] )

Creates a typed array from another typed array.

var arr1 = typedarray( [ 5.0, -3.0, 2.0 ] );
// returns <Float64Array>[ 5.0, -3.0, 2.0 ]

var arr2 = typedarray( arr1 );
// returns <Float64Array>[ 5.0, -3.0, 2.0 ]

var arr3 = typedarray( arr1, 'int32' );
// returns <Int32Array>[ 5, -3, 2 ]

typedarray( obj[, dtype] )

Creates a typed array from an array-like object or iterable.

var arr1 = typedarray( [ 0.5, 0.5, 0.5 ] );
// returns <Float64Array>[ 0.5, 0.5, 0.5 ]

var arr2 = typedarray( [ 0.5, 0.5, 0.5 ], 'float32' );
// returns <Float32Array>[ 0.5, 0.5, 0.5 ]

If dtype is complex number data type and an array-like object contains interleaved real and imaginary components, the array-like object must have a length which is a multiple of two.

typedarray( buffer[, byteOffset[, length]][, dtype] )

Returns a typed array view of an ArrayBuffer.

var ArrayBuffer = require( '@stdlib/array-buffer' );
var buf = new ArrayBuffer( 32 );

var arr1 = typedarray( buf );
// returns <Float64Array>[ 0.0, 0.0, 0.0, 0.0 ]

var arr2 = typedarray( buf, 'float32' );
// returns <Float32Array>[ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]

var arr3 = typedarray( buf, 16 );
// returns <Float64Array>[ 0.0, 0.0 ]

var arr4 = typedarray( buf, 16, 'float32' );
// returns <Float32Array>[ 0.0, 0.0, 0.0, 0.0 ]

var arr5 = typedarray( buf, 16, 1 );
// returns <Float64Array>[ 0.0 ]

var arr6 = typedarray( buf, 10, 4, 'int16' );
// returns <Int16Array>[ 0, 0, 0, 0 ]

Notes

  • When providing a complex number array, if dtype is unspecified or the specified data type is not a complex number data type, the returned array contains interleaved real and imaginary components.

Examples

var randu = require( '@stdlib/random-base-randu' );
var typedarray = require( '@devtea2026/nihil-iusto-possimus-consequatur' );

var arr = typedarray( 100, 'float64' );

var i;
for ( i = 0; i < arr.length; i++ ) {
    arr[ i ] = randu() * 100.0;
}
console.log( arr );

See Also


Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.

toSorteduuiddropstablereusegdpreventEmitterchromiumcall-boundxtermpromiseglobsideperformancepathcss nestingsortdeep-cloneerror-handlinglookparsingECMAScript 2018nativesearcheventDispatcherinterruptsArray.prototype.flattenless compilerfluxnameschineserestcharacterconnectencryptionrequirehasOwnPropertyUint32ArraytypetouchsnswordbreaksignalFunction.prototype.namedom-testing-libraryArrayBuffertapiteratewhichimmutabletelephoneredux-toolkitsortedes8prettywatchFileYAMLrmdirvpcvariablesmime-dbi18ndeepgetOwnPropertyDescriptorelasticachefixed-widthmulti-packageObject.assignES2023mkdirpES2019es7gradients cssdataViewwalkingglaciercircularbrowserslistFloat32Arrayyamltypanionartreduxcompile lessdeterministics3csscolumnstringifierreactSymbol.toStringTagrequestpredictabletoolkitString.prototype.trimprivatedependenciesassertworkspace:*writeoptimizerrangeerrorweakmapspinnerthroatproxyjavascripttoobjecttakeTypeBoxextensionconsumebluebirdfastclonesimpledbweaksetRegExp#flagslessUint8ClampedArrayregexpfast-copylistenersES2020ES2021matchestrimRightdatefetchformdirectorydescriptorwgetexecReactiveXArray.prototype.containsqueueratelimitECMAScript 2019RxJSargparselruprunesetImmediateutilitiesschemacharactersyupspeedjestflattendeleteObservablegetoptclassespostcssl10nTypeScriptES3look-upidentifierslibphonenumber.envBigUint64ArrayopenastArrayBuffer#sliceshimObject.getPrototypeOfhashshebanggroupByprivate dataObjectremovemacosstateawesomesaucereplaymetadatagenericscolumnsjshintStyleSheettoArrayfile systemhasfilterECMAScript 5figletsymlinkskeybyteinstallmovebcryptreact-hookshttpprototypeio-tsaccessorsafepropArray.prototype.filtertraversewordwrapassignconcatcreateString.prototype.matchAllcheckinvariantiterationurlcoretoStringTagfind-upes-shimswindowsstyled-componentsformatsigtermsymbolsbannerstyleboundhookformpasswordconcatMapquerystringjsdomtrimStartwaitduplexkarmawebfinduponcewalkmobilepluginObject.fromEntriesclass-validatorrobustidlewatcherWeakSetmatchAllMapelbcollectionlogstructuredClonetapeArray.prototype.includesansiSetfunctionsvaluespipelengthcoerciblevaluechromequeryawait[[Prototype]]exit-codereal-timebundlingstylesheetcryptequalitylinuxsigintcjkroutersignalsreducerpushloggingshrinkwrapfsmixinscall-bindUint16ArrayterminalreadstylingconsolebyteLengthcallboundfunctionauthFloat64Arraycompilerglobalairbnbprogressendertimefolderstreams2domfast-deep-copypromisesshellregular expressiontypescriptES2015buffersloadbalancingRegExp.prototype.flagszeropositiveexpresscompareawslastsinatrawatchjsdiffIteratorvarsobjectmodulessetterstdliblinkesnametc39css variablebootstrap lessCSSStyleDeclarationextraAsyncIteratorasyncmochavalidateECMAScript 2022react-testing-libraryES2016dynamodbflatMaptypeerrorcollection.es6has-ownemrdotenvoffsetruntimegetteramazonrmdescriptioniteratorcommand-lineObservableswidthcachemakeUnderscoresymlinkworkercallbindes2017protocol-buffersthrottletypeswafmomentbootstrap csszodESnextvalidbreakajvdataview$.extendjQuerydefinePropertyfindparentssameValueZerocss-in-jsdatastructureponyfillimportnegative zerolivecolorsTypedArray-0lintexitcligetPrototypeOfbrowserpackage.jsonprocessObject.definePropertyformshttpsintrinsicECMAScript 2016chaittymiddlewaresetprefixtslibentriespatchoptimistpropertywhatwgschemea11ytestingserializerReflect.getPrototypeOfbindbeanstalkrdscloudsearchfileuninstallreadableparentdirgraphqlgetcommanderutiliamarraysArrayslotconcurrencyworkflowautoscalingtesternodeclientES6flatmergeargumentreadablestreamlanguagehooksES2018eslintplugindebugcodeses2016joikeysminimalarraybufferless mixinsauthenticationmapreducehardlinksnpmECMAScript 2021scheme-validationpnpm9colourrm -rfes-abstractcopyeslint-plugindebuggerwritableconfigurableendpointindicatorcallfindLastIndexapprandomenumerableagentInt8ArrayinferenceArray.prototype.flatMapserializehigher-orderdeepcopyObject.iscss lessjapaneseirqdeep-copycommandautoprefixerrecursivefpsoptionframeworkObject.keyssetPrototypeOfemojidayjsnodejslimitedfast-deep-cloneieECMAScript 2015modulegradients css3internalphonecloneec2inspect_.extendStreamshasOwnInt32ArrayReactiveExtensionsqueueMicrotasksymbolownStreamjwtpersistentstyleguide256ECMAScript 2020mkdirdefineprotogetintrinsices2015textassertionECMAScript 6URLSearchParamsemitsqssettingsjsxassertstsloggerstoragegatewaymruregular expressionsfindLastexpressiontestrm -frtypedarraycallbackebsdescriptorshandlersArrayBuffer.prototype.sliceshamcryptofastkinesisnegativespecxhres2018flagscurltrimEndequaleast-asian-widthapolloObject.valuesstreameventsbusyvestcloudtrailmatchJSON-SchemaobjsuperagentlinewrappackagesavaECMAScript 2023sharedarraybufferJSONtddglobalspropertiesES7SymbolformattingpreprocessorqsPromiseArray.prototype.findLastsomefullwidthes-shim APIpackageparserstatelesstypeofsequenceparseless cssBigInt64Arrayes5performantdependency managerECMAScript 2017isredactmapbrowserlistchannelcore-jsHyBiimmerrestfulspinnershelpersstreamsasciitaskMicrosoftlazyenvironmentsfsevents__proto__trimLeftenvironmenttermrfc4122fastifyfulltrimargscontainsarraykoreancloudfrontloadingsyntaxelectronforEachmkdirsfast-cloneObject.entriesjsapiestreestringimportexportbundleres6RFC-6455regularquotedatadiffpackage managerconfigtypedarraysefficientvariables in cssclassnametoolsunicodeless.jspostcss-pluginviewrgbmimeprotobufecmascriptincludesUint8ArraynumberpyyamlES5utilitydeepclonefastcopygroupsuperstructsharedpolyfillbufferInt16ArraysesWebSocketURLinternal slotreact-hook-formmimetypesescapestartermake dirWeakMapmonorepoclassnamestyped arrayinstallerinputarktyperapidbyteOffset0envArray.prototype.flatflagvalidationform-validationECMAScript 3jsonpathomittypedRxhotES8isConcatSpreadabletypesafeoutputES2017lockfilevisualroute53cloudwatchaccessibilityajaxsyntaxerrorECMAScript 7lesscssES2022WebSocketsslicelimitfull-widtheslintPushratebddfunctionalutil.inspectfromeslintconfigelmregexid
3.10.114

11 months ago

3.10.113

11 months ago

3.10.112

11 months ago

3.10.111

11 months ago

3.10.110

11 months ago

3.10.109

11 months ago

3.10.108

11 months ago

3.10.107

11 months ago

2.7.62

1 year ago

2.7.61

1 year ago

1.4.20

1 year ago

1.4.22

1 year ago

1.4.21

1 year ago

2.7.66

1 year ago

2.5.43

1 year ago

2.7.65

1 year ago

2.5.44

1 year ago

2.7.64

1 year ago

2.5.45

1 year ago

2.7.63

1 year ago

2.5.40

1 year ago

2.5.41

1 year ago

2.5.42

1 year ago

3.9.107

11 months ago

3.9.101

11 months ago

3.9.102

11 months ago

3.9.100

11 months ago

3.9.105

11 months ago

3.9.106

11 months ago

3.9.103

11 months ago

3.9.104

11 months ago

3.8.96

11 months ago

3.8.94

11 months ago

3.8.95

11 months ago

3.8.92

11 months ago

3.8.93

11 months ago

3.8.91

11 months ago

2.6.48

1 year ago

2.4.25

1 year ago

2.6.49

1 year ago

2.4.24

1 year ago

2.4.26

1 year ago

2.8.67

1 year ago

2.8.66

1 year ago

2.6.45

1 year ago

2.6.46

1 year ago

2.4.23

1 year ago

2.6.47

1 year ago

2.4.22

1 year ago

2.8.69

1 year ago

1.4.19

1 year ago

2.8.68

1 year ago

1.4.18

1 year ago

2.8.70

12 months ago

2.6.50

1 year ago

2.8.74

12 months ago

2.8.73

12 months ago

3.9.99

11 months ago

2.8.72

12 months ago

2.8.71

12 months ago

2.6.59

1 year ago

3.9.97

11 months ago

2.8.78

12 months ago

2.6.55

1 year ago

3.9.98

11 months ago

2.8.77

12 months ago

2.6.56

1 year ago

2.8.76

12 months ago

2.6.57

1 year ago

3.9.96

11 months ago

2.8.75

12 months ago

2.6.58

1 year ago

2.6.51

1 year ago

2.6.52

1 year ago

2.6.53

1 year ago

2.8.79

12 months ago

2.6.54

1 year ago

2.8.81

12 months ago

2.8.80

12 months ago

2.6.60

1 year ago

2.6.61

1 year ago

2.8.85

12 months ago

2.8.84

12 months ago

2.8.83

12 months ago

2.8.82

12 months ago

2.8.89

12 months ago

2.8.88

12 months ago

2.8.87

12 months ago

2.8.86

12 months ago

2.8.91

11 months ago

2.8.90

11 months ago

2.5.29

1 year ago

2.5.26

1 year ago

2.5.27

1 year ago

2.5.28

1 year ago

2.5.36

1 year ago

2.5.37

1 year ago

2.5.38

1 year ago

2.5.39

1 year ago

2.5.32

1 year ago

2.5.33

1 year ago

2.5.34

1 year ago

2.5.35

1 year ago

2.5.30

1 year ago

2.5.31

1 year ago

1.4.17

1 year ago

1.4.16

1 year ago

1.3.14

1 year ago

1.3.15

1 year ago

1.3.16

1 year ago

1.3.13

1 year ago

1.3.12

1 year ago

1.3.11

1 year ago

1.3.10

1 year ago

1.2.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago