Skip to content

Commit d642697

Browse files
committed
docs: improve doctests for complex number instances in ndarray/base/unary
--- 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: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 6bea1e3 commit d642697

20 files changed

Lines changed: 58 additions & 20 deletions

lib/node_modules/@stdlib/ndarray/base/unary/lib/0d_accessors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@
4646
* @example
4747
* var Complex64Array = require( '@stdlib/array/complex64' );
4848
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
49+
* var realf = require( '@stdlib/complex/float32/real' );
50+
* var imagf = require( '@stdlib/complex/float32/imag' );
4951
*
5052
* function scale( z ) {
51-
* return new Complex64( z.re*10.0, z.im*10.0 );
53+
* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );
5254
* }
5355
*
5456
* // Create data buffers:

lib/node_modules/@stdlib/ndarray/base/unary/lib/10d_accessors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@
4949
* @example
5050
* var Complex64Array = require( '@stdlib/array/complex64' );
5151
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
52+
* var realf = require( '@stdlib/complex/float32/real' );
53+
* var imagf = require( '@stdlib/complex/float32/imag' );
5254
*
5355
* function scale( z ) {
54-
* return new Complex64( z.re*10.0, z.im*10.0 );
56+
* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );
5557
* }
5658
*
5759
* // Create data buffers:

lib/node_modules/@stdlib/ndarray/base/unary/lib/10d_blocked_accessors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ var blockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' );
5353
* @example
5454
* var Complex64Array = require( '@stdlib/array/complex64' );
5555
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
56+
* var realf = require( '@stdlib/complex/float32/real' );
57+
* var imagf = require( '@stdlib/complex/float32/imag' );
5658
*
5759
* function scale( z ) {
58-
* return new Complex64( z.re*10.0, z.im*10.0 );
60+
* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );
5961
* }
6062
*
6163
* // Create data buffers:

lib/node_modules/@stdlib/ndarray/base/unary/lib/1d_accessors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* var imagf = require( '@stdlib/complex/float32/imag' );
5151
*
5252
* function scale( z ) {
53-
* return new Complex64( z.re*10.0, z.im*10.0 );
53+
* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );
5454
* }
5555
*
5656
* // Create data buffers:

lib/node_modules/@stdlib/ndarray/base/unary/lib/2d_accessors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@
4747
* @example
4848
* var Complex64Array = require( '@stdlib/array/complex64' );
4949
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
50+
* var realf = require( '@stdlib/complex/float32/real' );
51+
* var imagf = require( '@stdlib/complex/float32/imag' );
5052
*
5153
* function scale( z ) {
52-
* return new Complex64( z.re*10.0, z.im*10.0 );
54+
* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );
5355
* }
5456
*
5557
* // Create data buffers:

lib/node_modules/@stdlib/ndarray/base/unary/lib/2d_blocked_accessors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ var blockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' );
5151
* @example
5252
* var Complex64Array = require( '@stdlib/array/complex64' );
5353
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
54+
* var realf = require( '@stdlib/complex/float32/real' );
55+
* var imagf = require( '@stdlib/complex/float32/imag' );
5456
*
5557
* function scale( z ) {
56-
* return new Complex64( z.re*10.0, z.im*10.0 );
58+
* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );
5759
* }
5860
*
5961
* // Create data buffers:

lib/node_modules/@stdlib/ndarray/base/unary/lib/3d_accessors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@
4747
* @example
4848
* var Complex64Array = require( '@stdlib/array/complex64' );
4949
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
50+
* var realf = require( '@stdlib/complex/float32/real' );
51+
* var imagf = require( '@stdlib/complex/float32/imag' );
5052
*
5153
* function scale( z ) {
52-
* return new Complex64( z.re*10.0, z.im*10.0 );
54+
* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );
5355
* }
5456
*
5557
* // Create data buffers:

lib/node_modules/@stdlib/ndarray/base/unary/lib/4d_accessors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@
4747
* @example
4848
* var Complex64Array = require( '@stdlib/array/complex64' );
4949
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
50+
* var realf = require( '@stdlib/complex/float32/real' );
51+
* var imagf = require( '@stdlib/complex/float32/imag' );
5052
*
5153
* function scale( z ) {
52-
* return new Complex64( z.re*10.0, z.im*10.0 );
54+
* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );
5355
* }
5456
*
5557
* // Create data buffers:

lib/node_modules/@stdlib/ndarray/base/unary/lib/4d_blocked_accessors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ var blockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' );
5353
* @example
5454
* var Complex64Array = require( '@stdlib/array/complex64' );
5555
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
56+
* var realf = require( '@stdlib/complex/float32/real' );
57+
* var imagf = require( '@stdlib/complex/float32/imag' );
5658
*
5759
* function scale( z ) {
58-
* return new Complex64( z.re*10.0, z.im*10.0 );
60+
* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );
5961
* }
6062
*
6163
* // Create data buffers:

lib/node_modules/@stdlib/ndarray/base/unary/lib/5d_accessors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@
4747
* @example
4848
* var Complex64Array = require( '@stdlib/array/complex64' );
4949
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
50+
* var realf = require( '@stdlib/complex/float32/real' );
51+
* var imagf = require( '@stdlib/complex/float32/imag' );
5052
*
5153
* function scale( z ) {
52-
* return new Complex64( z.re*10.0, z.im*10.0 );
54+
* return new Complex64( realf(z)*10.0, imagf(z)*10.0 );
5355
* }
5456
*
5557
* // Create data buffers:

0 commit comments

Comments
 (0)