Units of Measure Changelog

What's new in Units of Measure 1.5

Sep 17, 2013
  • Fixes Issue:
  • Floating-point paranoia: {KilometerPerHour[123.45] != KilometerPerHour[123.45]}
  • Host[Decimal|Double|Float].cs files have been modified to prevent conversion in such cases. Also, the order of floating-point operations has been changed to the one that looks a little more reasonable. Unit tests detected the change immediately and I had to modify them accordingly
  • Improvements:
  • New method(s) UnitSystem.TryParse to parse string input into Quantities/Levels. See [Quantity|Level]Tests.cs source code on details on how to use it.
  • Now UnitSystem constructor requires 2 parameters: int capacity and StringComparison lookup
  • This allows to specify capacity of the system explicitly and to to choose between case-sensitive and case-insensitive lookups of unit symbols
  • Sample systems SIUnits[Decimal|Double|Float].cs preseve parameterless constructor that creates UnitSystem with: capacity = 64, lookup = StringComparison.OrdinalIgnoreCase. The latter makes them behaving differently than in previous (case-sensitive) releases

New in Units of Measure 1.3 (Aug 12, 2013)

  • LevelCollection class added (for symmetry with QuantityCollection but somehow forgotten in previous releases)
  • Faster algorithms to multiply and divide dimensions. It increased ratio of quantity/plain calculation performance (as shown by the Demo application) of about 1/3
  • New operator "/" to divide quantity (level) by unit, giving numeric value of the quantity (level) as converted to that unit, but without creating new quantity (level) on the heap:
  • T quantvalue = Quantity / Measure; // == Quantity[Measure].Value
  • T levelvalue = Level / Measure // == Level[Measure].Value

New in Units of Measure 1.2 (Jul 20, 2013)

  • Minor improvements: superfluous static constructors removed