exp

Contents

exp#

class saiunit.math.exp(x, unit_to_scale=None, **kwargs)#

Calculate the exponential of all elements in the input.

If x is a Quantity with physical units, unit_to_scale must be provided to convert x to a dimensionless value first.

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

  • unit_to_scale (saiunit.Unit | None) – Unit used to convert x to a dimensionless number before applying the exponential.

Returns:

out – Element-wise exponential.

Return type:

Array

Examples

>>> import saiunit as u
>>> import jax.numpy as jnp
>>> u.math.exp(jnp.array([0.0, 1.0]))
Array([1.       , 2.7182817], dtype=float32)