Unit Statement
Identifies a unit of measure.
Syntax
Usual construct
[ @SI ] Unit unit_names [ = expression ]
Offset-scale construct
[ @SI ] Unit ( parameter In unit ) unit_names = expression
Parts
@SI
- Optional indication of an SI unit.
unit_names
- Mandatory one or more names with a space between each.
All names identify the same unit.
You can give the plurals of names with a plus sign, for example, “
meter+s
”. expression
- A conversion factor.
- Optional in the usual construct.
- Mandatory in the offset-scale construct.
parameter
- Mandatory in the offset-scale construct.
You use it with
expression
for a unit with an offset scale, for example, a unit of temperature. unit
- A different unit that is related to this unit.
Instructions
TODO
Examples
@SI Unit meter+s metre+s m
Unit light_year+s ly = 9.4605284 petameters
Unit Kelvin K
Unit (k In Kelvin) degree_C degrees_C = k + 273.15