@@ -69,6 +69,55 @@ v = croundf( new Complex64( NaN, NaN ) );
6969// returns <Complex64>[ NaN, NaN ]
7070```
7171
72+ #### croundf.assign( re, im, out, strideOut, offsetOut )
73+
74+ Rounds each component of a single-precision complex floating-point number to the nearest integer and assigns results to a provided output array.
75+
76+ ``` javascript
77+ var Float32Array = require ( ' @stdlib/array/float32' );
78+
79+ var out = new Float32Array ( 2 );
80+ var v = croundf .assign ( - 1.5 , 2.5 , out, 1 , 0 );
81+ // returns <Float32Array>[ -1.0, 3.0 ]
82+
83+ var bool = ( out === v );
84+ // returns true
85+ ```
86+
87+ The function supports the following parameters:
88+
89+ - ** re** : real component.
90+ - ** im** : imaginary component.
91+ - ** out** : output array.
92+ - ** strideOut** : stride length for ` out ` .
93+ - ** offsetOut** : starting index for ` out ` .
94+
95+ #### croundf.strided( z, sz, oz, out, so, oo )
96+
97+ Rounds each component of a single-precision complex floating-point number stored in a real-valued strided array view to the nearest integer and assigns results to a provided strided output array.
98+
99+ ``` javascript
100+ var Float32Array = require ( ' @stdlib/array/float32' );
101+
102+ var z = new Float32Array ( [ - 1.5 , 2.5 ] );
103+ var out = new Float32Array ( 2 );
104+
105+ var v = croundf .strided ( z, 1 , 0 , out, 1 , 0 );
106+ // returns <Float32Array>[ -1.0, 3.0 ]
107+
108+ var bool = ( out === v );
109+ // returns true
110+ ```
111+
112+ The function supports the following parameters:
113+
114+ - ** z** : complex number strided array view.
115+ - ** sz** : stride length for ` z ` .
116+ - ** oz** : starting index for ` z ` .
117+ - ** out** : output array.
118+ - ** so** : stride length for ` out ` .
119+ - ** oo** : starting index for ` out ` .
120+
72121</section >
73122
74123<!-- /.usage -->
@@ -80,18 +129,16 @@ v = croundf( new Complex64( NaN, NaN ) );
80129<!-- eslint no-undef: "error" -->
81130
82131``` javascript
83- var uniform = require ( ' @stdlib/random/base/uniform' ).factory ;
84- var Complex64 = require ( ' @stdlib/complex/float32/ctor' );
132+ var Complex64Array = require ( ' @stdlib/array/complex64' );
133+ var uniform = require ( ' @stdlib/random/array/uniform' );
134+ var logEachMap = require ( ' @stdlib/console/log-each-map' );
85135var croundf = require ( ' @stdlib/math/base/special/croundf' );
86136
87- var rand = uniform ( - 50.0 , 50.0 );
137+ // Create an array of random numbers:
138+ var arr = new Complex64Array ( uniform ( 200 , - 50.0 , 50.0 ) );
88139
89- var z;
90- var i;
91- for ( i = 0 ; i < 100 ; i++ ) {
92- z = new Complex64 ( rand (), rand () );
93- console .log ( ' croundf(%s) = %s' , z, croundf ( z ) );
94- }
140+ // Round each component of each complex number to the nearest integer:
141+ logEachMap ( ' croundf(%s) = %s' , arr, croundf );
95142```
96143
97144</section >
0 commit comments