Units of Measure 1.5

Rating: No reviews yet
Downloads: 96
Change Set: 8f9360fb00a6
Released: Sep 1, 2013
Updated: Sep 1, 2013 by manio
Dev status: Stable Help Icon

Recommended Download

Source Code UnitsOfMeasure 1.5.zip
source code, 618K, uploaded Sep 1, 2013 - 96 downloads

Release Notes

THESE MIGHT BE BREAKING CHANGES!

Fixes
  • Issue #2: 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<T> 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.

Reviews for this release

No reviews yet for this release.