File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
lib/node_modules/@stdlib/math/base/special/cinvf/examples Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1818
1919'use strict' ;
2020
21- var Complex64 = require ( '@stdlib/complex/float64/ctor' ) ;
22- var uniform = require ( '@stdlib/random/base/uniform' ) ;
23- var filledarrayBy = require ( '@stdlib/array/filled-by' ) ;
21+ var Complex64Array = require ( '@stdlib/array/complex64' ) ;
22+ var uniform = require ( '@stdlib/random/array/uniform' ) ;
2423var logEachMap = require ( '@stdlib/console/log-each-map' ) ;
2524var cinvf = require ( './../lib' ) ;
2625
27- function clbk ( ) {
28- return new Complex64 ( uniform ( - 50.0 , 50.0 ) , uniform ( - 50.0 , 50.0 ) ) ;
29- }
30- var arr = filledarrayBy ( 100 , 'complex64' , clbk ) ;
26+ // Create an array of random numbers:
27+ var arr = new Complex64Array ( uniform ( 200 , - 100.0 , 100.0 ) ) ;
3128
29+ // Compute the inverse of each number in the array:
3230logEachMap ( '1.0 / (%s) = %s' , arr , cinvf ) ;
You can’t perform that action at this time.
0 commit comments