Skip to main content

Number Intervals

Decipad has two types of intervals: sequences and ranges.

Creating a Sequence

Sequences allow you to create a series of values with a constant interval between each element. They are handy when you need to generate a sequence of numbers or dates without listing each element explicitly.

Syntax

[start .. end by step]

Example

You can have sequences of dates by specifying the step:

Creating a Range

Ranges represent a continuous interval of values between two endpoints. They are useful when you want to consider all the elements within a specified range of numbers or dates but you don't care about each individual element.

Syntax

range(start .. end)

If you prefer, you can also type a range as range(start through end), or range(start to end).

Example

You can also use the keyword contains to check wether a value is within a range.