Returns an iterator which invokes a ternary function accepting numeric arguments for each iterated value.
When invoked, the input function is provided three arguments:
x
: iterated value from first input iteratory
: iterated value from second input iteratorz
: iterated value from third input iteratorIf provided a numeric value as an iterator argument, the value is broadcast as an infinite iterator which always returns the provided value.
If an iterated value is non-numeric (including NaN
), the returned iterator returns NaN
. If non-numeric iterated values are possible, you are advised to provide an iterator which type checks and handles non-numeric values accordingly.
The length of the returned iterator is equal to the length of the shortest provided iterator. In other words, the returned iterator ends once one of the provided iterators ends.
If an environment supports Symbol.iterator
and all provided iterators are iterable, the returned iterator is iterable.
first iterator
third iterator
function which transforms iterated values
options
iterator
var uniform = require( `@stdlib/random/iter/uniform` );
var clamp = require( `@stdlib/math/base/special/clamp` );
var x = uniform( 0.0, 10.0 );
var min = uniform( 0.0, 1.0 );
var max = uniform( 9.0, 10.0 );
var iter = iterMap3( x, min, max, clamp );
var r = iter.next().value;
// returns <number>
r = iter.next().value;
// returns <number>
r = iter.next().value;
// returns <number>
// ...
Function which transforms iterated numeric values.
iterated value from first input iterator
iterated value from second input iterator
iterated value from third input iterator
result