Skip to content

Commit f2f0088

Browse files
committed
docs: improve doctests for complex number instances in array/complex64
--- 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: 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: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 7023a68 commit f2f0088

File tree

1 file changed

+4
-20
lines changed
  • lib/node_modules/@stdlib/array/complex64/docs/types

1 file changed

+4
-20
lines changed

lib/node_modules/@stdlib/array/complex64/docs/types/index.d.ts

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -572,12 +572,10 @@ declare class Complex64Array implements Complex64ArrayInterface {
572572
* @returns array element or undefined
573573
*
574574
* @example
575-
* var realf = require( '@stdlib/complex/float32/real' );
576-
* var imagf = require( '@stdlib/complex/float32/imag' );
577575
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
578576
*
579577
* function predicate( v ) {
580-
* return ( realf( v ) === imagf( v ) );
578+
* return ( v.re === v.im );
581579
* }
582580
*
583581
* var arr = new Complex64Array( 3 );
@@ -587,13 +585,7 @@ declare class Complex64Array implements Complex64ArrayInterface {
587585
* arr.set( [ 3.0, 3.0 ], 2 );
588586
*
589587
* var z = arr.find( predicate );
590-
* // returns <Complex64>
591-
*
592-
* var re = realf( z );
593-
* // returns 1.0
594-
*
595-
* var im = imagf( z );
596-
* // returns 1.0
588+
* // returns <Complex64>[ 1.0, 1.0 ]
597589
*/
598590
find<U = unknown>( predicate: Predicate<U>, thisArg?: ThisParameterType<Predicate<U>> ): Complex64 | void;
599591

@@ -859,11 +851,9 @@ declare class Complex64Array implements Complex64ArrayInterface {
859851
*
860852
* @example
861853
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
862-
* var realf = require( '@stdlib/complex/float32/real' );
863-
* var imagf = require( '@stdlib/complex/float32/imag' );
864854
*
865855
* function scale( v, i ) {
866-
* return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) );
856+
* return new Complex64( 2.0* v.re , 2.0*v.im );
867857
* }
868858
*
869859
* var arr = new Complex64Array( 3 );
@@ -876,13 +866,7 @@ declare class Complex64Array implements Complex64ArrayInterface {
876866
* // returns <Complex64Array>
877867
*
878868
* var z = out.get( 0 );
879-
* // returns <Complex64>
880-
*
881-
* var re = realf( z );
882-
* // returns 2.0
883-
*
884-
* var im = imagf( z );
885-
* // returns -2.0
869+
* // returns <Complex64>[ 2.0, -2.0 ]
886870
*/
887871
map<U = unknown>( fcn: MapFcn<U>, thisArg?: ThisParameterType<MapFcn<U>> ): Complex64Array;
888872

0 commit comments

Comments
 (0)