deno.com
interface Float16Array
unstable

A typed array of 16-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised.

Type Parameters #

#TArrayBuffer extends ArrayBufferLike = ArrayBufferLike

Index Signatures #

#[index: number]: number

Properties #

readonly
#BYTES_PER_ELEMENT: number

The size in bytes of each element in the array.

The ArrayBuffer instance referenced by the array.

readonly
#byteLength: number

The length in bytes of the array.

readonly
#byteOffset: number

The offset in bytes of the array.

readonly
#length: number

The length of the array.

readonly
#[[Symbol.toStringTag]]: "Float16Array"

Methods #

#at(index: number): number | undefined

Returns the item located at the specified index.

#copyWithin(
target: number,
start: number,
end?: number,
): this

Returns the this object after copying a section of the array identified by start and end to the same array starting at position target

#every(
predicate: (
value: number,
index: number,
array: this,
) => unknown
,
thisArg?: any,
): boolean

Determines whether all the members of an array satisfy the specified test.

#fill(
value: number,
start?: number,
end?: number,
): this

Changes all array elements from start to end index to a static value and returns the modified array

#filter(
predicate: (
value: number,
index: number,
array: this,
) => any
,
thisArg?: any,
): Float16Array<ArrayBuffer>

Returns the elements of an array that meet the condition specified in a callback function.

#find(
predicate: (
value: number,
index: number,
obj: this,
) => boolean
,
thisArg?: any,
): number | undefined

Returns the value of the first element in the array where predicate is true, and undefined otherwise.

#findIndex(
predicate: (
value: number,
index: number,
obj: this,
) => boolean
,
thisArg?: any,
): number

Returns the index of the first element in the array where predicate is true, and -1 otherwise.

#findLast<S extends number>(
predicate: (
value: number,
index: number,
array: this,
) => value is S
,
thisArg?: any,
): S | undefined

Returns the value of the last element in the array where predicate is true, and undefined otherwise.

#findLast(
predicate: (
value: number,
index: number,
array: this,
) => unknown
,
thisArg?: any,
): number | undefined
#findLastIndex(
predicate: (
value: number,
index: number,
array: this,
) => unknown
,
thisArg?: any,
): number

Returns the index of the last element in the array where predicate is true, and -1 otherwise.

#forEach(
callbackfn: (
value: number,
index: number,
array: this,
) => void
,
thisArg?: any,
): void

Performs the specified action for each element in an array.

#includes(
searchElement: number,
fromIndex?: number,
): boolean

Determines whether an array includes a certain element, returning true or false as appropriate.

#indexOf(
searchElement: number,
fromIndex?: number,
): number

Returns the index of the first occurrence of a value in an array.

#join(separator?: string): string

Adds all the elements of an array separated by the specified separator string.

#lastIndexOf(
searchElement: number,
fromIndex?: number,
): number

Returns the index of the last occurrence of a value in an array.

#map(
callbackfn: (
value: number,
index: number,
array: this,
) => number
,
thisArg?: any,
): Float16Array<ArrayBuffer>

Calls a defined callback function on each element of an array, and returns an array that contains the results.

#reduce(callbackfn: (
previousValue: number,
currentValue: number,
currentIndex: number,
array: this,
) => number
): number

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

#reduce(
callbackfn: (
previousValue: number,
currentValue: number,
currentIndex: number,
array: this,
) => number
,
initialValue: number,
): number
#reduce<U>(
callbackfn: (
previousValue: U,
currentValue: number,
currentIndex: number,
array: this,
) => U
,
initialValue: U,
): U

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

#reduceRight(callbackfn: (
previousValue: number,
currentValue: number,
currentIndex: number,
array: this,
) => number
): number

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

#reduceRight(
callbackfn: (
previousValue: number,
currentValue: number,
currentIndex: number,
array: this,
) => number
,
initialValue: number,
): number
#reduceRight<U>(
callbackfn: (
previousValue: U,
currentValue: number,
currentIndex: number,
array: this,
) => U
,
initialValue: U,
): U

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

#reverse(): this

Reverses the elements in an Array.

#set(
array: ArrayLike<number>,
offset?: number,
): void

Sets a value or an array of values.

#slice(
start?: number,
end?: number,
): Float16Array<ArrayBuffer>

Returns a section of an array.

#some(
predicate: (
value: number,
index: number,
array: this,
) => unknown
,
thisArg?: any,
): boolean

Determines whether the specified callback function returns true for any element of an array.

#sort(compareFn?: (
a: number,
b: number,
) => number
): this

Sorts an array.

#subarray(
begin?: number,
end?: number,
): Float16Array<TArrayBuffer>

Gets a new Float16Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive.

#toLocaleString(
locales?: string | string[],
options?: Intl.NumberFormatOptions,
): string

Converts a number to a string by using the current locale.

#toReversed(): Float16Array<ArrayBuffer>

Copies the array and returns the copy with the elements in reverse order.

#toSorted(compareFn?: (
a: number,
b: number,
) => number
): Float16Array<ArrayBuffer>

Copies and sorts the array.

#toString(): string

Returns a string representation of an array.

#valueOf(): this

Returns the primitive value of the specified object.

#with(
index: number,
value: number,
): Float16Array<ArrayBuffer>

Copies the array and inserts the given number at the provided index.

#[[Symbol.iterator]](): ArrayIterator<number>
#entries(): ArrayIterator<[number, number]>

Returns an array of key, value pairs for every entry in the array

#keys(): ArrayIterator<number>

Returns an list of keys in the array

#values(): ArrayIterator<number>

Returns an list of values in the array