runs as written · runs with Bentrix's own convention, said in its note · refused by name, the note says what Bentrix lacks · not yet built.
Functions
array.abs#
array.abs(id: arr) → arrsameA new array of absolute values
id | arr | required |
array.avg#
array.avg(id: arr) → floatThe mean
id | arr | required |
array.binary_search#
array.binary_search(id: arr, val: num) → intThe index of the value in a sorted array, or -1
id | arr | required |
val | num | required |
array.binary_search_leftmost#
array.binary_search_leftmost(id: arr, val: num) → intThe index of the value, or of the element before where it would stand
id | arr | required |
val | num | required |
array.binary_search_rightmost#
array.binary_search_rightmost(id: arr, val: num) → intThe index of the value, or of the element after where it would stand
id | arr | required |
val | num | required |
array.clear#
array.clear(id: arr)Removes every element
id | arr | required |
array.concat#
array.concat(id1: arr, id2: arr) → arrsameAppends the second to the first and answers the first
id1 | arr | required |
id2 | arr | required |
array.copy#
array.copy(id: arr) → arrsameA shallow copy
id | arr | required |
array.covariance#
array.covariance(id1: arr, id2: arr, biased: bool?) → floatThe population covariance; the sample form where biased is false
id1 | arr | required |
id2 | arr | required |
biased | bool | optional |
array.every#
array.every(id: arr) → boolWhether every element is true
id | arr | required |
array.fill#
array.fill(id: arr, value: elem, index_from: int?, index_to: int?)Sets every element in the range
id | arr | required |
value | elem | required |
index_from | int | optional |
index_to | int | optional |
array.first#
array.first(id: arr) → elemThe first element
id | arr | required |
array.from#
array.from(arg0: T, args: T...) → arr<T>An array of the arguments
arg0 | T | required |
args | T... | required |
array.get#
array.get(id: arr, index: int) → elemThe element at an index; a negative index counts from the end
id | arr | required |
index | int | required |
array.includes#
array.includes(id: arr, value: elem) → boolWhether an element equals the value
id | arr | required |
value | elem | required |
array.indexof#
array.indexof(id: arr, value: elem) → intThe first index of the value, or -1
id | arr | required |
value | elem | required |
array.insert#
array.insert(id: arr, index: int, value: elem)Inserts at an index
id | arr | required |
index | int | required |
value | elem | required |
array.join#
array.join(id: arr, separator: string?) → stringThe elements as text, joined
id | arr | required |
separator | string | optional |
array.last#
array.last(id: arr) → elemThe last element
id | arr | required |
array.lastindexof#
array.lastindexof(id: arr, value: elem) → intThe last index of the value, or -1
id | arr | required |
value | elem | required |
array.max#
array.max(id: arr, nth: int?) → elemThe greatest, or the nth greatest
id | arr | required |
nth | int | optional |
array.median#
array.median(id: arr) → floatThe middle value
id | arr | required |
array.min#
array.min(id: arr, nth: int?) → elemThe least, or the nth least
id | arr | required |
nth | int | optional |
array.mode#
array.mode(id: arr) → elemThe most frequent element, the smallest of several; na is not counted
id | arr | required |
array.new#
array.new(size: int?, initial_value: any?) → arr<G>A new array of the generic type
size | int | optional |
initial_value | any | optional |
array.new_bool#
array.new_bool(size: int?, initial_value: bool?) → arr<bool>A new array of bools
size | int | optional |
initial_value | bool | optional |
array.new_color#
array.new_color(size: int?, initial_value: color?) → arr<color>A new array of colours
size | int | optional |
initial_value | color | optional |
array.new_float#
array.new_float(size: int?, initial_value: num?) → arr<float>A new array of floats
size | int | optional |
initial_value | num | optional |
array.new_int#
array.new_int(size: int?, initial_value: int?) → arr<int>A new array of ints
size | int | optional |
initial_value | int | optional |
array.new_string#
array.new_string(size: int?, initial_value: string?) → arr<string>A new array of strings
size | int | optional |
initial_value | string | optional |
array.percentile_linear_interpolation#
array.percentile_linear_interpolation(id: arr, percentage: num) → floatThe percentile at p/100 × (n - 1) between its two neighbours
id | arr | required |
percentage | num | required |
array.percentile_nearest_rank#
array.percentile_nearest_rank(id: arr, percentage: num) → floatThe value at rank ceil (p/100 × n)
id | arr | required |
percentage | num | required |
array.percentrank#
array.percentrank(id: arr, index: int) → floatThe percentage of the other elements not above the indexed one
id | arr | required |
index | int | required |
array.pop#
array.pop(id: arr) → elemRemoves and answers the last
id | arr | required |
array.push#
array.push(id: arr, value: elem)Appends
id | arr | required |
value | elem | required |
array.range#
array.range(id: arr) → floatThe greatest minus the least
id | arr | required |
array.remove#
array.remove(id: arr, index: int) → elemRemoves and answers the element at an index
id | arr | required |
index | int | required |
array.reverse#
array.reverse(id: arr)Reverses in place
id | arr | required |
array.set#
array.set(id: arr, index: int, value: elem)Replaces the element at an index
id | arr | required |
index | int | required |
value | elem | required |
array.shift#
array.shift(id: arr) → elemRemoves and answers the first
id | arr | required |
array.size#
array.size(id: arr) → intThe count of elements
id | arr | required |
array.slice#
array.slice(id: arr, index_from: int, index_to: int) → arrsameA COPY of the elements from index_from up to index_to
id | arr | required |
index_from | int | required |
index_to | int | required |
array.some#
array.some(id: arr) → boolWhether an element is true
id | arr | required |
array.sort#
array.sort(id: arr, order: any?)Sorts in place, ascending unless order.descending
id | arr | required |
order | any | optional |
array.sort_indices#
array.sort_indices(id: arr, order: any?) → arr<int>The indices that would sort it
id | arr | required |
order | any | optional |
array.standardize#
array.standardize(id: arr) → arr<float>Each element less the mean, over the population standard deviation
id | arr | required |
array.stdev#
array.stdev(id: arr, biased: bool?) → floatThe population standard deviation by two passes; the sample form where biased is false
id | arr | required |
biased | bool | optional |
array.sum#
array.sum(id: arr) → floatThe sum
id | arr | required |
array.unshift#
array.unshift(id: arr, value: elem)Inserts at the front
id | arr | required |
value | elem | required |
array.variance#
array.variance(id: arr, biased: bool?) → floatThe population variance by two passes; the sample form where biased is false
id | arr | required |
biased | bool | optional |