scipp.divide#

scipp.divide(dividend, divisor)#

Element-wise true division.

Equivalent to:

dividend / divisor

The result always contains fractional parts even when the inputs are integers:

Parameters:
  • dividend (VariableLike) – Dividend of the quotient.

  • divisor (VariableLike) – Divisor of the quotient.

Returns:

VariableLike – Quotient of divident and divisor.

Examples

>>> sc.divide(sc.arange('x', -2, 3), sc.scalar(2)).values
array([-1. , -0.5,  0. ,  0.5,  1. ])
>>> sc.divide(sc.arange('x', -2.0, 3.0), sc.scalar(2.0)).values
array([-1. , -0.5,  0. ,  0.5,  1. ])

Of equivalently in operator notation

>>> (sc.arange('x', -2.0, 3.0) / sc.scalar(2.0)).values
array([-1. , -0.5,  0. ,  0.5,  1. ])

Note

See the guide on computation for general concepts and broadcasting behavior.