Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "math/iter/ops/divide/docs/types/index.d"

Index

Type aliases

Functions

Type aliases

Iterator

Iterator: Iter | IterableIterator

Functions

Export assignment iterDivide

  • Returns an iterator which performs element-wise division of two or more iterators.

    Notes

    • If 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.
    throws

    must provide two or more iterators

    throws

    must provide iterator protocol-compliant objects

    Parameters

    • iter0: Iterator | number

      first iterator

    • iter1: Iterator | number

      second iterator

    • Rest ...iterN: Array<Iterator | number>

      subsequent iterators

    Returns Iterator

    iterator

    Example

    var array2iterator = require( `@stdlib/array/to-iterator` );
    
    var it1 = array2iterator( [ 3.0, 4.0 ] );
    var it2 = array2iterator( [ 1.0, 8.0 ] );
    
    var iter = iterDivide( it1, it2 );
    
    var v = iter.next().value;
    // returns 3.0
    
    v = iter.next().value;
    // returns 0.5
    
    var bool = iter.next().done;
    // returns true