Skip to content

Commit da8c11e

Browse files
kgryteNeerajpathak07
authored andcommitted
docs: update copy
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent fec0baa commit da8c11e

File tree

1 file changed

+7
-7
lines changed
  • lib/node_modules/@stdlib/ndarray/base/unary-accumulate

1 file changed

+7
-7
lines changed

lib/node_modules/@stdlib/ndarray/base/unary-accumulate/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Character codes for data types:
181181
Function name suffix naming convention:
182182

183183
```text
184-
stdlib_ndarray_<input_data_type><accumulator_data_type>_<output_data_type>[_as_<callback_arg1_data_type><callback_arg2_data_type>_<callback_return_data_type>]
184+
stdlib_ndarray_<accumulation_data_type><input_data_type>_<output_data_type>[_as_<callback_arg1_data_type><callback_arg2_data_type>_<callback_return_data_type>]
185185
```
186186

187187
For example,
@@ -192,7 +192,7 @@ For example,
192192
void stdlib_ndarray_accumulate_dd_d(...) {...}
193193
```
194194
195-
is a function which accepts one double-precision floating-point input ndarray and one double-precision floating-point output ndarray and performs accumulation in double-precision. In other words, the suffix encodes the function type signature.
195+
is a function which performs accumulation in double-precision and accepts one double-precision floating-point input ndarray and one double-precision floating-point output ndarray. In other words, the suffix encodes the function type signature.
196196
197197
To support callbacks whose input arguments and/or return values are of a different data type than the input and/or output ndarray data types, the naming convention supports appending an `as` suffix. For example,
198198
@@ -202,23 +202,23 @@ To support callbacks whose input arguments and/or return values are of a differe
202202
void stdlib_ndarray_accumulate_ff_f_as_dd_d(...) {...}
203203
```
204204

205-
is a function which accepts one single-precision floating-point input ndarray and one single-precision floating-point output ndarray and performs accumulation in single-precision. However, the callback accepts and returns double-precision floating-point numbers. Accordingly, the input and output values need to be cast using the following conversion sequence
205+
is a function which performs accumulation in single-precision and accepts one single-precision floating-point input ndarray and one single-precision floating-point output ndarray. However, the callback accepts and returns double-precision floating-point numbers. Accordingly, the input and output values need to be cast using the following conversion sequence
206206

207207
```c
208-
// Convert each input array element to double-precision:
209-
double in1 = (double)x[ i ];
210-
211208
// Convert the current accumulated value to double-precision:
212209
double curr = (double)acc;
213210

211+
// Convert each input array element to double-precision:
212+
double in1 = (double)x[ i ];
213+
214214
// Evaluate the callback:
215215
double out = f( curr, in1 );
216216

217217
// Convert the callback return value to single-precision:
218218
acc = (float)out;
219219
```
220220

221-
The accumulator data type and the output ndarray data type should **always** be the same.
221+
The accumulation data type and the output ndarray data type should **always** be the same.
222222

223223
The callback is invoked with two arguments:
224224

0 commit comments

Comments
 (0)