ge d2c5ad5d2f version 0.6.0
* Check for zero step value to void infinite loops
* Add `new()` fn for creating ranges with checks
* Add `to_array()` method
* Add `is_empty()` method
* Add more tests
2026-07-15 01:09:33 +03:00
2025-12-26 22:41:29 +03:00
2025-12-26 22:38:52 +03:00
2025-12-26 22:38:52 +03:00
2025-12-26 22:38:52 +03:00
2026-07-15 01:09:33 +03:00
2026-07-15 01:09:33 +03:00
2025-12-30 15:43:51 +03:00
2025-12-26 22:38:52 +03:00
2026-07-15 01:09:33 +03:00

Operating with Ranges of Numbers

The ranges module provides tools for creating ranges of numbers.

Ranges are represented by the generic Range iterator, which has start and end points and a step size.

import ranges

// Iterate from 0 to 5 with step 2. Negative values also supported.
for i in ranges.range(0, 5, 2) {
	println(i)
}
// 0
// 2
// 4

See more usage examples in ranges_test.v.

S
Description
No description provided
Readme
62 KiB
Languages
V 100%