Skip to main content

Long

Library of functions for the long type.

Functions

From

Builds a long from a number or string.

Syntax:
Long.From(value: number or string)
Parameters
  • value: The value to convert to long.
Returns
  • long: The long representation of the value.
Example:
Long.From(1)
// Result:
// 1L

Long.From("1")
// Result:
// 1L

Long.From(1.5)
// Result:
// 1L

Range

Builds a collection of longs between two specified values.

Syntax:
Long.Range(start: int, end: int, step: optional int)
Parameters
  • start: The starting value.

  • end: The end value (not included).

  • step: The step value (default: 1L).

Returns
  • collection(long): The collection of longs between start and end (not included) with the given step interval.
Example:
Long.Range(0L, 10L, step=2L)
// Result:
// [0L, 2L, 4L, 6L, 8L]