cfunits.Units.log

Units.log(base)[source]

Returns the logarithmic unit corresponding to a log base.

Parameters
base: int or float

The logarithmic base.

Returns
Units

The logarithmic unit corresponding to the given logarithmic base.

Examples

>>> u = Units('W', names=True)
>>> u
<Units: watt>
>>> u.log(10)
<Units: lg(re 1 W)>
>>> u.log(2)
<Units: lb(re 1 W)>
>>> import math
>>> u.log(math.e)
<Units: ln(re 1 W)>
>>> u.log(3.5)
<Units: 0.798235600147928 ln(re 1 W)>