around

Contents

around#

class saiunit.math.around(x, decimals=0, **kwargs)#

Round an array to the nearest integer.

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

  • decimals (int) – Number of decimal places to round to (default is 0).

Returns:

out – Rounded values. Quantity if x is a Quantity.

Return type:

Array | saiunit.Quantity

Examples

>>> import saiunit as u
>>> a = [1.2, 2.7, 3.1] * u.second
>>> u.math.around(a)