Complex number constructor.
An n-ary function accepting complex numbers.
Nullary function.
Quaternary function accepting complex numbers.
Quinary function accepting complex numbers.
Real or complex number.
Ternary function accepting complex numbers.
Unary function accepting complex numbers.
Binary function accepting both real and complex numbers.
An n-ary function accepting both real and complex numbers.
Quaternary function accepting both real and complex numbers.
Quinary function accepting both real and complex numbers.
Ternary function accepting both real and complex numbers.
Unary function accepting both real and complex numbers.
Wraps a nullary function accepting complex number arguments to support providing both real and complex numbers.
nullary function to wrap
number of arguments
complex number constructor
wrapped function
var Complex64 = require( `@stdlib/complex/float32` );
var realf = require( `@stdlib/complex/realf` );
var imagf = require( `@stdlib/complex/imagf` );
var randu = require( `@stdlib/random/base/randu` );
function randComplex() {
return new Complex64( randu(), randu() );
}
var f = wrap( randComplex, 0, Complex64 );
// ...
var z = f();
// returns <Complex64>
var re = realf( z );
// returns <number>
var im = imagf( z );
// returns <number>
Wraps a unary function accepting complex number arguments to support providing both real and complex numbers.
number
), then the input argument is a complex number. The returned function does not verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.function to wrap
number of arguments
complex number constructor
wrapped function
var Complex64 = require( `@stdlib/complex/float32` );
var cidentityf = require( `@stdlib/math/base/special/cidentityf` );
var realf = require( `@stdlib/complex/realf` );
var imagf = require( `@stdlib/complex/imagf` );
var f = wrap( cidentityf, 1, Complex64 );
// ...
var z = f( 3.0 );
// returns <Complex64>
var re = realf( z );
// returns 3.0
var im = imagf( z );
// returns 0.0
Wraps a binary function accepting complex number arguments to support providing both real and complex numbers.
number
), then the input argument is a complex number. The returned function does not verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.function to wrap
number of arguments
complex number constructor
wrapped function
var Complex64 = require( `@stdlib/complex/float32` );
var cadd = require( `@stdlib/math/base/ops/cadd` );
var realf = require( `@stdlib/complex/realf` );
var imagf = require( `@stdlib/complex/imagf` );
var f = wrap( cadd, 2, Complex64 );
// ...
var z = f( 3.0, 4.0 );
// returns <Complex64>
var re = realf( z );
// returns 7.0
var im = imagf( z );
// returns 0.0
Wraps a ternary function accepting complex number arguments to support providing both real and complex numbers.
number
), then the input argument is a complex number. The returned function does not verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.function to wrap
number of arguments
complex number constructor
wrapped function
var Complex64 = require( `@stdlib/complex/float32` );
var realf = require( `@stdlib/complex/realf` );
var imagf = require( `@stdlib/complex/imagf` );
function add( x, y, z ) {
var re = realf( x ) + realf( y ) + realf( z );
var im = imagf( x ) + imagf( y ) + imagf( z );
return new Complex64( re, im );
}
var f = wrap( add, 3, Complex64 );
// ...
var z = f( 3.0, 4.0, 5.0 );
// returns <Complex64>
var re = realf( z );
// returns 12.0
var im = imagf( z );
// returns 0.0
Wraps a quaternary function accepting complex number arguments to support providing both real and complex numbers.
number
), then the input argument is a complex number. The returned function does not verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.function to wrap
number of arguments
complex number constructor
wrapped function
var Complex64 = require( `@stdlib/complex/float32` );
var realf = require( `@stdlib/complex/realf` );
var imagf = require( `@stdlib/complex/imagf` );
function add( x, y, z, w ) {
var re = realf( x ) + realf( y ) + realf( z ) + realf( w );
var im = imagf( x ) + imagf( y ) + imagf( z ) + imagf( w );
return new Complex64( re, im );
}
var f = wrap( add, 4, Complex64 );
// ...
var z = f( 3.0, 4.0, 5.0, 6.0 );
// returns <Complex64>
var re = realf( z );
// returns 18.0
var im = imagf( z );
// returns 0.0
Wraps a quinary function accepting complex number arguments to support providing both real and complex numbers.
number
), then the input argument is a complex number. The returned function does not verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.function to wrap
number of arguments
complex number constructor
wrapped function
var Complex64 = require( `@stdlib/complex/float32` );
var realf = require( `@stdlib/complex/realf` );
var imagf = require( `@stdlib/complex/imagf` );
function add( x, y, z, w, v ) {
var re = realf( x ) + realf( y ) + realf( z ) + realf( w ) + realf( v );
var im = imagf( x ) + imagf( y ) + imagf( z ) + imagf( w ) + imagf( v );
return new Complex64( re, im );
}
var f = wrap( add, 5, Complex64 );
// ...
var z = f( 3.0, 4.0, 5.0, 6.0, 7.0 );
// returns <Complex64>
var re = realf( z );
// returns 25.0
var im = imagf( z );
// returns 0.0
Wraps an n-ary function accepting complex number arguments to support providing both real and complex numbers.
number
), then the input argument is a complex number. The returned function does not verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.function to wrap
number of arguments
complex number constructor
wrapped function
var Complex64 = require( `@stdlib/complex/float32` );
var realf = require( `@stdlib/complex/realf` );
var imagf = require( `@stdlib/complex/imagf` );
function add( x, y, z, w, v, t ) {
var re = realf( x ) + realf( y ) + realf( z ) + realf( w ) + realf( v ) + realf( t );
var im = imagf( x ) + imagf( y ) + imagf( z ) + imagf( w ) + imagf( v ) + imagf( t );
return new Complex64( re, im );
}
var f = wrap( add, 6, Complex64 );
// ...
var z = f( 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 );
// returns <Complex64>
var re = realf( z );
// returns 33.0
var im = imagf( z );
// returns 0.0
Binary function accepting complex numbers.
input value
input value
result