Skip to content

Commit a7f2da0

Browse files
committed
fix: #3396 improve documentation of function range
1 parent c7705cd commit a7f2da0

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
missing from the generated function overview.
88
- Fix #3517: `printTransformDependencies` not exported in the type definitions.
99
- Fix: add missing type definition for function `diff` (#3520). Thanks @dodokw.
10+
- Fix: #3396 improve documentation of function `range`.
1011

1112
# 2025-07-25, 14.6.0
1213

src/function/matrix/range.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'sm
66

77
export const createRange = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, bignumber, smaller, smallerEq, larger, largerEq, add, isPositive }) => {
88
/**
9-
* Create an array from a range.
9+
* Create a matrix or array containing a range of values.
1010
* By default, the range end is excluded. This can be customized by providing
1111
* an extra parameter `includeEnd`.
1212
*
@@ -34,10 +34,12 @@ export const createRange = /* #__PURE__ */ factory(name, dependencies, ({ typed,
3434
* - `includeEnd: boolean`
3535
* Option to specify whether to include the end or not. False by default.
3636
*
37-
* Note that the return type of the range is taken from the type of
38-
* the start/end. If only one these is a built-in `number` type, it will
39-
* be promoted to the type of the other endpoint. However, in the case of
40-
* Unit values, both endpoints must have compatible units, and the return
37+
* The function returns a `DenseMatrix` when the library is configured with
38+
* `config = { matrix: 'Matrix' }, and returns an Array otherwise.
39+
* Note that the type of the returned values is taken from the type of the
40+
* provided start/end value. If only one of these is a built-in `number` type,
41+
* it will be promoted to the type of the other endpoint. However, in the case
42+
* of Unit values, both endpoints must have compatible units, and the return
4143
* value will have compatible units as well.
4244
*
4345
* Examples:

0 commit comments

Comments
 (0)