Units of measurement for Ada 2.1 review

Download
by rbytes.net on

Units of measurement for Ada library provides an implementation of dimensioned values for Ada

License: GMGPL (GNAT Modified GPL)
File size: 778K
Developer: Dmitry Kazakov
0 stars award from rbytes.net

Units of measurement for Ada library provides an implementation of dimensioned values for Ada. Unit checks are made at run-time, if not optimized out by the compiler. SI and irregular measurement units are supported.

Shifted units like degrees Celsius are supported too. Conversions from and back to strings are provided for all various irregular units.

Here are some key features of "Units of measurement for Ada":
The type Unit denotes the dimension of a physical entity. The type Measure represents a dimensioned value;
Mixed unit arithmetic. Values in SI (Le Syst?me International d'Unit?s) units can be mixed with irregular units (such as foot and yard) as long as the result is defined;
Shifted unit support (a widely used instance of a shifted unit is degree of Celsius);
The type Measure is generic, parameterized by a floating-point type. A non-generic version based on the type Float is also provided;
String to Measure conversion supports as wide set of irregular units as possible.
Currently the powers of the base unit components lie in the range -8..7. This limitation has an implementation reason (absence of 64-bit modular integers in many Ada compilers).

What's New in This Release:
The code was tested with GNAT Ada 2005 (GCC 4.0.2 20051125).

Units of measurement for Ada 2.1 search tags