Return True if and only if numeric values in one unit are convertible to numeric values in the other unit and their conversion is a scale factor of 1.
Parameters : |
|
---|---|
Returns : |
|
Examples
>>> u = Units(units='km')
>>> v = Units(units='1000m')
>>> u.equals(v)
True
>>> u = Units(units='m s-1')
>>> m = Units(units='m')
>>> s = Units(units='s')
>>> u.equals(m)
False
>>> u.equals(m/s)
True
>>> (m/s).equals(u)
True
Undefined units are considered equal:
>>> u = Units()
>>> v = Units()
>>> u.equals(v)
True