-
Notifications
You must be signed in to change notification settings - Fork 0
API Float64Array
Fixed-length packed array of 64-bit floating-point numbers.
Float64Array is a primitive-backed array for allocation-efficient floating-point workloads. Elements live in contiguous native double storage and can hold fractions, general numeric values, NaN, and infinities.
The length is fixed at construction. push, pop, and element deletion are unavailable; elements are read and written through numeric indexes.
var weights = new Float64Array(2);
weights[0] = 1.25;
return weights[0]; // 1.25Warning
Indexing outside 0 to length - 1 raises a runtime error. Validate computed indexes before reading or writing.
Use Int32Array when every element is a whole number, or Array when the element type must vary or the collection has to grow.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
length |
number |
No | Non-negative element count. Omitting it creates an empty array. |
Returns
Float64Array — a fixed-length array whose elements start at 0.
Example
var rates = new Float64Array(4);
return rates[3]; // 0Returns
number — the fixed element count.
Behavior
Read-only. The value never changes for a given instance.
Example
return new Float64Array(5).length; // 5Parameters
| Name | Type | Required | Description |
|---|---|---|---|
value |
number |
No | Value written to every element. Defaults to 0. |
Returns
Float64Array — this array, so calls can be chained.
Behavior
Every element is overwritten in place with the numeric conversion of the value.
Example
var rates = new Float64Array(3);
rates.fill(0.5);
return rates[1]; // 0.5AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License