Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

array.double

import array

Everything here is re-exported by array, so import array is enough and the names are called as array.*. Importing array.double on its own works too and reaches the same definitions.

DoubleArray: a packed array of double-precision IEEE 754 floats, 8 bytes per element.

DOUBLE_MAX and DOUBLE_MIN are the largest and smallest finite values the type can hold.

Constants

DOUBLE_MAX

array.DOUBLE_MAX: number

Maximum value that “should” exist in a list passed to DoubleArray.

DOUBLE_MIN

array.DOUBLE_MIN: number

Minimum value that “should” exist in a list passed to DoubleArray.

Classes

DoubleArray

class array.DoubleArray < Array

class DoubleArray represents an array of 64-bit IEEE-754 floating-point numbers (doubles) in the platform byte order.

  • printable — has a @to_string(), so echo and print() show something useful
  • serializable — has a @to_json(), so it can be handed straight to json.encode()
  • valueable — has a @to_value(), so it converts to a plain Zuri value

DoubleArray.reverse()

array.DoubleArray.reverse() -> DoubleArray

Returns a new array containing the elements in the original array in reverse order.

Returns DoubleArray

DoubleArray.clone()

array.DoubleArray.clone() -> DoubleArray

Returns a new DoubleArray containing all items from the current array. The new array is a shallow copy of the original array.

Returns DoubleArray

DoubleArray.slice()

array.DoubleArray.slice(start, end) -> DoubleArray

Returns a new DoubleArray over [start, end) of this array (both default to the whole array; negative bounds count from the end).

Parameters

  • start (?number)
  • end (?number)

Returns DoubleArray


2021, Richard Ore and Zuri contributors