time-to-botec/squiggle/node_modules/@stdlib/array/convert/docs/repl.txt
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

40 lines
947 B
Plaintext

{{alias}}( arr, dtype )
Converts an input array to an array of a different data type.
The function supports the following data types:
- float32: single-precision floating-point numbers.
- float64: double-precision floating-point numbers.
- generic: values of any type.
- int16: signed 16-bit integers.
- int32: signed 32-bit integers.
- int8: signed 8-bit integers.
- uint16: unsigned 16-bit integers.
- uint32: unsigned 32-bit integers.
- uint8: unsigned 8-bit integers.
- uint8c: unsigned clamped 8-bit integers.
Parameters
----------
arr: Array|TypedArray
Array to convert.
dtype: string
Output data type.
Returns
-------
out: Array|TypedArray
Output array.
Examples
--------
> var arr = [ 1.0, 2.0, 3.0, 4.0 ];
> var out = {{alias}}( arr, 'float32' )
<Float32Array>[ 1.0, 2.0, 3.0, 4.0 ]
See Also
--------