-
-
Notifications
You must be signed in to change notification settings - Fork 907
docs: change examples for complex/float64/base/div
#7180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
729f019
ca13422
f0b277e
ed31e23
fbd30d1
6497200
030e95b
f9dd9d2
36759f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,23 +18,14 @@ | |
|
||
'use strict'; | ||
|
||
var Complex128 = require( '@stdlib/complex/float64/ctor' ); | ||
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); | ||
var Complex128Array = require( '@stdlib/array/complex128' ); | ||
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); | ||
var logEachMap = require( '@stdlib/console/log-each-map' ); | ||
var cdiv = require( './../lib' ); | ||
|
||
function randomComplex() { | ||
var re = discreteUniform( -50, 50 ); | ||
var im = discreteUniform( -50, 50 ); | ||
return new Complex128( re, im ); | ||
} | ||
// Generate arrays of random values: | ||
var z1 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); | ||
var z2 = new Complex128Array( discreteUniform( 200, -50, 50 ) ); | ||
|
||
var z1; | ||
var z2; | ||
var z3; | ||
var i; | ||
for ( i = 0; i < 100; i++ ) { | ||
z1 = randomComplex(); | ||
z2 = randomComplex(); | ||
z3 = cdiv( z1, z2 ); | ||
console.log( '(%s) / (%s) = %s', z1.toString(), z2.toString(), z3.toString() ); | ||
} | ||
// Perform division for each element of arrays | ||
|
||
logEachMap( '(%s) * (%s) = %s', z1, z2, cdiv ); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect. cc @Planeshifter