physical 0.7.0
physical: ^0.7.0 copied to clipboard
Lightweight library for dealing with physical quantities, units, and conversions.
0.7.0 #
- Breaking:
QuantityandUnithash codes are now consistent with equality, as required byObject.hashCode. Equal quantities expressed in different units (1 mand1000 mm) previously hashed differently, so aSetorMapkept both - Breaking:
Quantitycomparison is now performed in SI base units rather than by converting one operand to the units of the other, which previously made equality asymmetric for ~7% of unit conversions - Breaking:
Quantity.operator ==now returnsfalsefor mismatched dimensions rather than throwing, asList.containsand other collection operations rely on it.compareToand the ordering operators still throw - Breaking: a scalar
Quantityis no longer equal to thenumit represents.numcould not return the same in reverse, and the comparison was reported asunrelated_type_equality_checksat every call site.Scalar's ordering operators still accept anum - Breaking:
QuantityPointhash codes now follow its existing equality, which compares the distance from absolute zero regardless of units and origin - Added
QuantityPointstring functions, showing the origin where the unit does not imply it - Added
OffsetUnit, a unit measured from aUnit.implicitOrigin;degreeCelsiusanddegreeFahrenheitare now offset units - Added
QuantityOriginequality,isZeroandtoString - Fixed the names of
degreeCelsius, which had none, and the plural ofkelvin
0.6.2 #
- Added
AreaPerTimeandAnglePerTimequantities
0.6.1 #
- Add fixed precision functions Quantity.toPrecision and Quantity.toFixedAsStringNoTrailing
0.6.0 #
- Renamed
systemstounits - Moved scalar units to
units/scalar.dart - Quantity.scaled() now accepts a
numas well as aQuantity
0.5.0 #
- Various improvements.