Logo

A performant, verbose and generic physical unit system.

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qunits.Quantity  (  value unit = None  )[source]

The base class for quantities. - Multiplying or dividing an array_like with a Unit will return a Quantity. - Multiplying or dividing a Quantity by a Unit will return a new Quantity with the same value and the combined unit. - Multiplying or dividing two Quantity instances will return a new Quantity with the combined value and the combined unit. - Multiplying or dividing a Quantity by an array_like will return a new Quantity with the scaled value and the same unit.

Parameters:
valuearray_like | Quantity

The value of the quantity.

unitUnit | None

The unit of the quantity.