iscomplexobj

Contents

iscomplexobj#

class brainunit.math.iscomplexobj(x, **kwargs)#

Return True if x is a complex type or an array of complex numbers.

Units are stripped before the check is performed.

Parameters:

x (Array | ndarray | bool | number | bool | int | float | complex | saiunit.Quantity) – Input array or Quantity.

Returns:

outTrue if x is a complex type or an array of complex numbers.

Return type:

bool

Examples

>>> import saiunit as u
>>> import jax.numpy as jnp
>>> u.math.iscomplexobj(jnp.array([1.0, 2.0]))
False
>>> u.math.iscomplexobj(jnp.array([1.0 + 2.0j]))
True