|
The following table uses <> (angle brackets) to note the possible syntax that is user-defined with the values shown in the Legal Values column.
|
Syntax for Building a Supported Unit String
|
|
Syntax
|
Legal Values
|
<compound_unit>
|
• <known_compound_unit>
• <unknown_compound_unit>
• (<compound_unit>)
• <compound_unit><integer_power>
• <compound_unit><operation><compound_unit>
|
<integer_power>
|
• ** int
• ^ int
|
<real_power>
|
• ** real
^ real
|
<operation>
|
• *
• /
|
<pure_unit>
|
• any symbol from the Pure Units Table
|
<base_unit>
|
• any symbol from the Base Units Table
|
<unit_prefix>
|
• any symbol from the Unit Prefix Table
|
<known_unit>
|
• <pure_unit>
• <unit_prefix> <pure_unit>
|
<known_compound_unit>
|
• <known _unit>
• (<known_compound_unit>)
• <known_compound_unit><integer_power>
• <known_compound_unit><operation><known_compound_unit>
|
<unknown_unit>
|
• any symbol that is not a <known_unit>
|
<unknown_compound_unit>
|
• <unknown_unit>
• <known_compound_unit><real_power>
• <unknown_compound_unit><real_power>
|
<base_compound_unit>
|
• <base_unit>
• <base_unit><integer_power> (where base_unit index is greater than 0, and integer_power is greater than 0)
• <base_compound_unit><operation><base_unit> (where base_unit index is greater than all base_unit indices within base_compound_unit)
|
Operator
|
Description
|
Precedence
|
()
|
parenthesis
|
1
|
**
|
power
|
2
|
^
|
power
|
2
|
*
|
multiply
|
3
|
/
|
divide
|
3
|
Examples of Supported Unit Strings
|
||
Supported Unit String:
|
Examples:
|
Definition
|
Base Unit strings:
|
• kg*m/s**2
• cd/m**2
|
Base unit strings are all <base_compound_unit> strings.
All base unit strings are convertible units strings.
|
Convertible Unit strings:
|
• kg*m/s**2
• A**2/kg/m**2*s**4
• 1/um
• oz/s
• (N*m)**-3
|
Convertible unit strings are all <known_compound_unit> strings.
|
Non-convertible Unit strings:
|
• foo
• foo**1.4
• W**0.5
|
Non-convertible unit strings are all <unknown_compound_unit> strings.
The sets of convertible units strings and non-convertible units strings have no intersection.
|