Skip to content

Commit f85fc88

Browse files
committed
Auto-generated commit
1 parent faeeab4 commit f85fc88

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@
202202

203203
### Bug Fixes
204204

205+
- [`de5763c`](https://github.com/stdlib-js/stdlib/commit/de5763c0ae79e809d74237f084b066411be59f0d) - replace policy string with policy object
205206
- [`05e83e1`](https://github.com/stdlib-js/stdlib/commit/05e83e1582cfeef43b39227e4a5c891f9934d1c0) - resolve typo in include guard
206207
- [`a996667`](https://github.com/stdlib-js/stdlib/commit/a9966678dedd564a74999f2c4c5bd47c9a2b0c64) - propagate sign to the accumulated sum
207208
- [`ee80204`](https://github.com/stdlib-js/stdlib/commit/ee80204dfe9c9a6409ebd7873354371bbdbac32e) - propagate sign to the accumulated sum
@@ -411,6 +412,7 @@ A total of 17 issues were closed in this release:
411412

412413
<details>
413414

415+
- [`de5763c`](https://github.com/stdlib-js/stdlib/commit/de5763c0ae79e809d74237f084b066411be59f0d) - **fix:** replace policy string with policy object _(by Athan Reines)_
414416
- [`b9d5fc2`](https://github.com/stdlib-js/stdlib/commit/b9d5fc27dcdc1d57f94f63be1d05276c63025c14) - **docs:** update namespace table of contents [(#6819)](https://github.com/stdlib-js/stdlib/pull/6819) _(by stdlib-bot, Philipp Burckhardt)_
415417
- [`9f85b5d`](https://github.com/stdlib-js/stdlib/commit/9f85b5d90cb6fcaf052116cd06aa4a693757f0ec) - **test:** fix description _(by Philipp Burckhardt)_
416418
- [`05e83e1`](https://github.com/stdlib-js/stdlib/commit/05e83e1582cfeef43b39227e4a5c891f9934d1c0) - **fix:** resolve typo in include guard _(by Philipp Burckhardt)_

ext/sum/lib/main.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,10 @@ var factory = require( '@stdlib/ndarray/base/unary-reduce-strided1d-dispatch-fac
3131

3232
var idtypes = dtypes( 'numeric_and_generic' );
3333
var odtypes = dtypes( 'numeric_and_generic' );
34-
35-
// FIXME: consider defining an "accumulation" policy so that small integer arrays do not readily overflow (see the Array API Standard; if changed, need to update the README accordingly)
36-
37-
// FIXME: may need to consider C arithmetic emulation, including for signed/unsigned integers, in order to ensure consistent results (currently, `gsum` accumulates in double-precision in JS; however, given that integer summation is modulo arithmetic, this may not be an issue, as the results may be the same)
38-
39-
// FIXME: per the Array API Standard, if the output dtype differs from the input dtype, the input ndarray should be cast prior to computation (ref: https://data-apis.org/array-api/latest/API_specification/generated/array_api.sum.html)
40-
var policy = 'same';
34+
var policies = {
35+
'output': 'accumulation',
36+
'casting': 'promoted'
37+
};
4138
var table = {
4239
'types': [
4340
'float64', // input
@@ -98,7 +95,7 @@ var table = {
9895
* var v = out.get();
9996
* // returns 39.0
10097
*/
101-
var sum = factory( table, [ idtypes ], odtypes, policy );
98+
var sum = factory( table, [ idtypes ], odtypes, policies );
10299

103100

104101
// EXPORTS //

0 commit comments

Comments
 (0)