Module defining unit prefixe class and some constants.
Constant dict for SI and binary prefixes are defined as PREFIXES and BIN_PREFIXES.
- class sympy.physics.units.prefixes.Prefix(name, abbrev, exponent, base=10, latex_repr=None)[source]#
This class represent prefixes, with their name, symbol and factor.
Prefixes are used to create derived units from a given unit. They should always be encapsulated into units.
The factor is constructed from a base (default is 10) to some power, and it gives the total multiple or fraction. For example the kilometer km is constructed from the meter (factor 1) and the kilo (10 to the power 3, i.e. 1000). The base can be changed to allow e.g. binary prefixes.
A prefix multiplied by something will always return the product of this other object times the factor, except if the other object:
is a prefix and they can be combined into a new prefix;
defines multiplication with prefixes (which is the case for the Unit class).