Skip to content

Commit f973a5d

Browse files
committed
fix: examples
--- 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: passed - 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 a2b2606 commit f973a5d

File tree

2 files changed

+46
-10
lines changed
  • lib/node_modules/@stdlib/ndarray/base/binary-input-casting-dtype

2 files changed

+46
-10
lines changed

lib/node_modules/@stdlib/ndarray/base/binary-input-casting-dtype/README.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ limitations under the License.
1818
1919
-->
2020

21+
<!-- eslint-disable id-length -->
22+
2123
# binaryInputCastingDataType
2224

2325
> Resolve the input ndarray casting [data type][@stdlib/ndarray/dtypes] for a binary function.
@@ -36,6 +38,8 @@ limitations under the License.
3638

3739
## Usage
3840

41+
<!-- eslint-disable id-length -->
42+
3943
```javascript
4044
var binaryInputCastingDataType = require( '@stdlib/ndarray/base/binary-input-casting-dtype' );
4145
```
@@ -44,6 +48,8 @@ var binaryInputCastingDataType = require( '@stdlib/ndarray/base/binary-input-cas
4448

4549
Resolves the input ndarray casting [data type][@stdlib/ndarray/dtypes] for a binary function according to a [data type policy][@stdlib/ndarray/input-casting-policies].
4650

51+
<!-- eslint-disable id-length -->
52+
4753
```javascript
4854
var dt = binaryInputCastingDataType( 'int32', 'int32', 'float64', 'promoted' );
4955
// returns 'float64'
@@ -58,6 +64,8 @@ The function supports the following parameters:
5864

5965
If `policy` is a [data type][@stdlib/ndarray/dtypes], the function always returns the `policy` value (i.e., the fourth argument).
6066

67+
<!-- eslint-disable id-length -->
68+
6169
```javascript
6270
var dt = binaryInputCastingDataType( 'float32', 'float32', 'float64', 'complex128' );
6371
// returns 'complex128'
@@ -92,23 +100,37 @@ dt = binaryInputCastingDataType( 'int32', 'float64', 'float64', 'complex128' );
92100
var naryFunction = require( '@stdlib/utils/nary-function' );
93101
var unzip = require( '@stdlib/utils/unzip' );
94102
var nCartesianProduct = require( '@stdlib/array/base/n-cartesian-product' );
95-
var dtypes = require( '@stdlib/ndarray/dtypes' );
96103
var logEachMap = require( '@stdlib/console/log-each-map' );
97104
var inputCastingDataType = require( '@stdlib/ndarray/base/binary-input-casting-dtype' );
98105

99-
// Get the list of real-valued data types:
100-
var dt = dtypes( 'real' );
106+
var idt1 = [
107+
'float32',
108+
'float64'
109+
];
110+
111+
var idt2 = [
112+
'int8',
113+
'uint8',
114+
'uint16',
115+
'uint32'
116+
];
117+
118+
var odt = [
119+
'float32',
120+
'float64',
121+
'complex64',
122+
'complex128'
123+
];
101124

102125
// Define a list of casting policies:
103126
var policies = [
104-
'none',
105127
'promoted',
106128
'accumulation',
107129
'output'
108130
];
109131

110132
// Generate dtype-policy argument groups:
111-
var args = nCartesianProduct( dt, dt, policies );
133+
var args = nCartesianProduct( idt1, idt2, odt, policies );
112134

113135
// Unzip the argument arrays:
114136
args = unzip( args );

lib/node_modules/@stdlib/ndarray/base/binary-input-casting-dtype/examples/index.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,37 @@
2121
var naryFunction = require( '@stdlib/utils/nary-function' );
2222
var unzip = require( '@stdlib/utils/unzip' );
2323
var nCartesianProduct = require( '@stdlib/array/base/n-cartesian-product' );
24-
var dtypes = require( '@stdlib/ndarray/dtypes' );
2524
var logEachMap = require( '@stdlib/console/log-each-map' );
2625
var inputCastingDataType = require( './../lib' );
2726

28-
// Get the list of real-valued data types:
29-
var dt = dtypes( 'real' );
27+
var idt1 = [
28+
'float32',
29+
'float64'
30+
];
31+
32+
var idt2 = [
33+
'int8',
34+
'uint8',
35+
'uint16',
36+
'uint32'
37+
];
38+
39+
var odt = [
40+
'float32',
41+
'float64',
42+
'complex64',
43+
'complex128'
44+
];
3045

3146
// Define a list of casting policies:
3247
var policies = [
33-
'none',
3448
'promoted',
3549
'accumulation',
3650
'output'
3751
];
3852

3953
// Generate dtype-policy argument groups:
40-
var args = nCartesianProduct( dt, dt, dt, policies );
54+
var args = nCartesianProduct( idt1, idt2, odt, policies );
4155

4256
// Unzip the argument arrays:
4357
args = unzip( args );

0 commit comments

Comments
 (0)