Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "ndarray/promotion-rules/docs/types/index.d"

Index

Interfaces

Functions

Functions

promotionRules

  • promotionRules(dtype1: any, dtype2: any): number | string | null
  • promotionRules(): Table
  • Returns the ndarray data type with the smallest size and closest "kind" to which ndarray data types can be safely cast.

    Parameters

    • dtype1: any

      ndarray data type value

    • dtype2: any

      ndarray data type value

    Returns number | string | null

    promotion rule(s) or null

    Example

    var dt = promotionRules( 'float32', 'uint32' );
    // returns 'float64'

    Example

    var dt = promotionRules( 'binary', 'generic' );
    // returns -1

    Example

    var dt = promotionRules( 'float32', 'foo' );
    // returns null
  • Returns a type promotion table displaying the ndarray data types with the smallest size and closest "kind" to which ndarray data types can be safely cast.

    Returns Table

    promotion rule table

    Example

    var table = promotionRules();
    // returns {...}