Skip to content

Commit 338c0d3

Browse files
committed
Auto-generated commit
1 parent 7dba2c9 commit 338c0d3

File tree

3 files changed

+50
-4
lines changed

3 files changed

+50
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-11-10)
7+
## Unreleased (2025-11-13)
88

99
<section class="features">
1010

@@ -22,6 +22,8 @@
2222

2323
<details>
2424

25+
- [`9ef2243`](https://github.com/stdlib-js/stdlib/commit/9ef2243e74763fa05f732c476492b18e9d3711c1) - **docs:** add notes _(by Athan Reines)_
26+
- [`c84485f`](https://github.com/stdlib-js/stdlib/commit/c84485fea2e4dfabf2d07dcfa9dabe68a854f72f) - **docs:** update notes _(by Athan Reines)_
2527
- [`b3817aa`](https://github.com/stdlib-js/stdlib/commit/b3817aa9b503e211474c485bc381251d47aa308b) - **docs:** fix function signature and remove extrs spaces _(by Philipp Burckhardt)_
2628
- [`af7c8c4`](https://github.com/stdlib-js/stdlib/commit/af7c8c4e389209dd4004613c251d449e99ba09f7) - **style:** add missing spaces _(by Philipp Burckhardt)_
2729
- [`c46348e`](https://github.com/stdlib-js/stdlib/commit/c46348e63572c385a5a10c111a0214c9bb28eeec) - **docs:** update copy _(by Athan Reines)_

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,29 @@ dlinspace.ndarray( 3, 1.0, 3.0, true, x, 1, x.length-3 );
148148

149149
## Notes
150150

151-
- Let `M` be the number of generated values (which is either `N` or `N+1` depending on whether `endpoint` is `true` or `false`, respectively). The spacing between values is thus given by `Δ = (stop-start)/(M-1)`.
151+
- Let `M` be the number of generated values (which is either `N` or `N+1` depending on whether `endpoint` is `true` or `false`, respectively). The spacing between values is thus given by
152+
153+
```text
154+
Δ = (stop-start)/(M-1)
155+
```
156+
157+
- When the number of generated values is greater than `1` and `endpoint` is `true`, the set of values written to a provided input array is guaranteed to include the `start` and `stop` values. Beware, however, that values between `start` and `stop` are subject to floating-point rounding errors. Hence,
158+
159+
```javascript
160+
var Float64Array = require( '@stdlib/array-float64' );
161+
162+
var x = new Float64Array( [ 0.0, 0.0, 0.0 ] );
163+
164+
dlinspace( 3, 0.0, 1.0, true, x, 1 );
165+
// x => <Float64Array>[ 0.0, ~0.5, 1.0 ]
166+
```
167+
168+
where `x[1]` is only guaranteed to be approximately equal to `0.5`.
169+
170+
- When `N = 1` and `endpoint` is `false`, only the `start` value is written to a provided input array. When `N = 1` and `endpoint` is `true`, only the `stop` value is written to a provided input array.
171+
172+
- If `start < stop`, values are written to a provided input array in ascending order; otherwise, values are written in descending order.
173+
152174
- If `N <= 0`, both functions return `x` unchanged.
153175
154176
</section>

docs/repl.txt

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
Fills a double-precision floating-point strided array with linearly spaced
44
values over a specified interval.
55

6+
If `N = 1` and `endpoint` is `true`, the set of values written to an input
7+
array only includes `stop`, but not `start`; otherwise, when `N = 1` and
8+
`endpoint` is `false`, the set of values written to an input array only
9+
includes `start`, but not `stop`.
10+
11+
If `start` is less than `stop`, the set of values written to an input array
12+
will be written in ascending order, and, if `start` is greater than
13+
`stop`, the set of written values will be in descending order.
14+
15+
When `N >= 2` and `endpoint` is `true`, the set of values written to an
16+
input array is guaranteed to include the `start` and `stop` values. Beware,
17+
however, that values between `start` and `stop` are subject to floating-
18+
point rounding errors.
19+
620
The `N` and stride parameters determine which elements in the strided array
721
are accessed at runtime.
822

@@ -24,7 +38,11 @@
2438

2539
endpoint: boolean
2640
Boolean indicating whether to include the `stop` value when writing
27-
values to the input array.
41+
values to the input array. If `false`, the function generates `N+1`
42+
linearly spaced values over the interval `[start, stop]` and only writes
43+
`N` values to the input array, thus excluding `stop` from the input
44+
array. Accordingly, for a fixed `N`, the spacing between adjacent values
45+
written to an input array changes depending on the value of `endpoint`.
2846

2947
x: Float64Array
3048
Input array.
@@ -79,7 +97,11 @@
7997

8098
endpoint: boolean
8199
Boolean indicating whether to include the `stop` value when writing
82-
values to the input array.
100+
values to the input array. If `false`, the function generates `N+1`
101+
linearly spaced values over the interval `[start, stop]` and only writes
102+
`N` values to the input array, thus excluding `stop` from the input
103+
array. Accordingly, for a fixed `N`, the spacing between adjacent values
104+
written to an input array changes depending on the value of `endpoint`.
83105

84106
x: Float64Array
85107
Input array.

0 commit comments

Comments
 (0)