Loading…

An Ada package for dimensional analysis

This paper illustrates the use of Ada's abstraction facilities-notably, operator overloading and type parameterization-to define an oft-requested feature: a way to attribute units of measure to variables and values. The definition given allows the programmer to specify units of measure for vari...

Full description

Saved in:
Bibliographic Details
Published in:ACM transactions on programming languages and systems 1988-04, Vol.10 (2), p.189-203
Main Author: Hilfinger, Paul N.
Format: Article
Language:English
Subjects:
Citations: Items that this one cites
Items that cite this one
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary:This paper illustrates the use of Ada's abstraction facilities-notably, operator overloading and type parameterization-to define an oft-requested feature: a way to attribute units of measure to variables and values. The definition given allows the programmer to specify units of measure for variables, constants, and parameters; checks uses of these entities for dimensional consistency; allows arithmetic between them, where legal; and provides scale conversions between commensurate units. It is not constrained to a particular system of measurement (such as the metric or English systems). Although the definition is in standard Ada and requires nothing special of the compiler, certain reasonable design choices in the compiler, discussed here at some length, can make its implementation particularly efficient.
ISSN:0164-0925
1558-4593
DOI:10.1145/42190.42346