Skip to content

Commit 95c53cf

Browse files
docs: improve doctests for complex number instances in math/base/special/csignumf
PR-URL: #9042 Ref: #8641 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent 82bc0ec commit 95c53cf

File tree

6 files changed

+14
-107
lines changed

6 files changed

+14
-107
lines changed

lib/node_modules/@stdlib/math/base/special/csignumf/README.md

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,35 +46,14 @@ Evaluates the [signum][signum] function of a single-precision complex floating-p
4646

4747
```javascript
4848
var Complex64 = require( '@stdlib/complex/float32/ctor' );
49-
var real = require( '@stdlib/complex/float32/real' );
50-
var imag = require( '@stdlib/complex/float32/imag' );
51-
5249
var v = csignumf( new Complex64( -4.2, 5.5 ) );
53-
// returns <Complex64>
54-
55-
var re = real( v );
56-
// returns ~-0.607
57-
58-
var im = imag( v );
59-
// returns ~0.795
50+
// returns <Complex64>[ ~-0.607, ~0.795 ]
6051

6152
v = csignumf( new Complex64( 0.0, 0.0 ) );
62-
// returns <Complex64>
63-
64-
re = real( v );
65-
// returns 0.0
66-
67-
im = imag( v );
68-
// returns 0.0
53+
// returns <Complex64>[ 0.0, 0.0 ]
6954

7055
v = csignumf( new Complex64( NaN, NaN ) );
71-
// returns <Complex64>
72-
73-
re = real( v );
74-
// returns NaN
75-
76-
im = imag( v );
77-
// returns NaN
56+
// returns <Complex64>[ NaN, NaN ]
7857
```
7958

8059
</section>

lib/node_modules/@stdlib/math/base/special/csignumf/docs/repl.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
Examples
1717
--------
1818
> var v = {{alias}}( new {{alias:@stdlib/complex/float32/ctor}}( -4.2, 5.5 ) )
19-
<Complex64>
20-
> var re = {{alias:@stdlib/complex/float32/real}}( v )
21-
~-0.607
22-
> var im = {{alias:@stdlib/complex/float32/imag}}( v )
23-
~0.795
19+
<Complex64>[ ~-0.607, ~0.795 ]
2420

2521
See Also
2622
--------

lib/node_modules/@stdlib/math/base/special/csignumf/docs/types/index.d.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,9 @@ import { Complex64 } from '@stdlib/types/complex';
3030
*
3131
* @example
3232
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
33-
* var real = require( '@stdlib/complex/float32/real' );
34-
* var imag = require( '@stdlib/complex/float32/imag' );
3533
*
3634
* var v = csignumf( new Complex64( -4.2, 5.5 ) );
37-
* // returns <Complex64>
38-
*
39-
* var re = real( v );
40-
* // returns ~-0.607
41-
*
42-
* var im = imag( v );
43-
* // returns ~0.795
35+
* // returns <Complex64>[ ~-0.607, ~0.795 ]
4436
*/
4537
declare function csignumf( z: Complex64 ): Complex64;
4638

lib/node_modules/@stdlib/math/base/special/csignumf/lib/index.js

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,16 @@
2525
*
2626
* @example
2727
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
28-
* var real = require( '@stdlib/complex/float32/real' );
29-
* var imag = require( '@stdlib/complex/float32/imag' );
3028
* var csignumf = require( '@stdlib/math/base/special/csignumf' );
3129
*
3230
* var v = csignumf( new Complex64( -4.2, 5.5 ) );
33-
* // returns <Complex64>
34-
*
35-
* var re = real( v );
36-
* // returns ~-0.607
37-
*
38-
* var im = imag( v );
39-
* // returns ~0.795
31+
* // returns <Complex64>[ ~-0.607, ~0.795 ]
4032
*
4133
* v = csignumf( new Complex64( 0.0, 0.0 ) );
42-
* // returns <Complex64>
43-
*
44-
* re = real( v );
45-
* // returns 0.0
46-
*
47-
* im = imag( v );
48-
* // returns 0.0
34+
* // returns <Complex64>[ 0.0, 0.0 ]
4935
*
5036
* v = csignumf( new Complex64( NaN, NaN ) );
51-
* // returns <Complex64>
52-
*
53-
* re = real( v );
54-
* // returns NaN
55-
*
56-
* im = imag( v );
57-
* // returns NaN
37+
* // returns <Complex64>[ NaN, NaN ]
5838
*/
5939

6040
// MODULES //

lib/node_modules/@stdlib/math/base/special/csignumf/lib/main.js

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,15 @@ var cabsf = require( '@stdlib/math/base/special/cabsf' );
3737
*
3838
* @example
3939
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
40-
* var real = require( '@stdlib/complex/float32/real' );
41-
* var imag = require( '@stdlib/complex/float32/imag' );
4240
*
4341
* var v = csignumf( new Complex64( -4.2, 5.5 ) );
44-
* // returns <Complex64>
45-
*
46-
* var re = real( v );
47-
* // returns ~-0.607
48-
*
49-
* var im = imag( v );
50-
* // returns ~0.795
42+
* // returns <Complex64>[ ~-0.607, ~0.795 ]
5143
*
5244
* v = csignumf( new Complex64( 0.0, 0.0 ) );
53-
* // returns <Complex64>
54-
*
55-
* re = real( v );
56-
* // returns 0.0
57-
*
58-
* im = imag( v );
59-
* // returns 0.0
45+
* // returns <Complex64>[ 0.0, 0.0 ]
6046
*
6147
* v = csignumf( new Complex64( NaN, NaN ) );
62-
* // returns <Complex64>
63-
*
64-
* re = real( v );
65-
* // returns NaN
66-
*
67-
* im = imag( v );
68-
* // returns NaN
48+
* // returns <Complex64>[ NaN, NaN ]
6949
*/
7050
function csignumf( z ) {
7151
var re;

lib/node_modules/@stdlib/math/base/special/csignumf/lib/native.js

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,15 @@ var addon = require( './../src/addon.node' );
3535
*
3636
* @example
3737
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
38-
* var real = require( '@stdlib/complex/float32/real' );
39-
* var imag = require( '@stdlib/complex/float32/imag' );
4038
*
4139
* var v = csignumf( new Complex64( -4.2, 5.5 ) );
42-
* // returns <Complex64>
43-
*
44-
* var re = real( v );
45-
* // returns ~-0.607
46-
*
47-
* var im = imag( v );
48-
* // returns ~0.795
40+
* // returns <Complex64>[ ~-0.607, ~0.795 ]
4941
*
5042
* v = csignumf( new Complex64( 0.0, 0.0 ) );
51-
* // returns <Complex64>
52-
*
53-
* re = real( v );
54-
* // returns 0.0
55-
*
56-
* im = imag( v );
57-
* // returns 0.0
43+
* // returns <Complex64>[ 0.0, 0.0 ]
5844
*
5945
* v = csignumf( new Complex64( NaN, NaN ) );
60-
* // returns <Complex64>
61-
*
62-
* re = real( v );
63-
* // returns NaN
64-
*
65-
* im = imag( v );
66-
* // returns NaN
46+
* // returns <Complex64>[ NaN, NaN ]
6747
*/
6848
function csignumf( z ) {
6949
var v = addon( z );

0 commit comments

Comments
 (0)