quantities

The purpose of this package is to perform automatic compile-time or runtime dimensional checking when dealing with quantities and units.

Requires: DMD 2.065+

Modules

base
module quantities.base

This module defines the base types for unit and quantity handling.

math
module quantities.math

This module defines common math operations on quantities.

parsing
module quantities.parsing

This module defines functions to parse units and quantities. The text input is parsed according to the following grammar. For example:

Prefixes and unit symbols must be joined:
"1 mm" = 1 millimeter
"1 m m" = 1 square meter


Standalone units are preferred over prefixed ones:
"1 cd" = 1 candela, not 1 centiday


Powers of units:
"1 m^2"
"1 m²" (superscript integer)


Multiplication of to units:
"1 N m" (whitespace)
"1 N . m"
"1 N ⋅ m" (centered dot)
"1 N * m"
"1 N × m" (times sign)


Division of to units:
"1 mol / s"
"1 mol ÷ s"


Grouping of units with parentheses:
"1 kg/(m.s^2)" = 1 kg m⁻¹ s⁻²
si
module quantities.si

This module defines the SI units and prefixes.

Public Imports

quantities.base
public import quantities.base;
Undocumented in source.
quantities.math
public import quantities.math;
Undocumented in source.
quantities.si
public import quantities.si;
Undocumented in source.
quantities.parsing
public import quantities.parsing;
Undocumented in source.

Meta

Authors

Nicolas Sicard