UNIT: Difference between revisions

From iMath
Jump to navigation Jump to search
(Created page with "{{Keyword | <code>UNIT ( expression )</code> | Try to find a quantity (number with optional units) for the expression from any equations defined previously in the document...")
 
No edit summary
 
Line 17: Line 17:
|
|
4=
4=
[[QUANTITY]] [[QUANTITYWITH]] [[NUMVAL]] [[NUMVALWITH]] [[VAL]] [[VALWITH]] [[UNITWITH]]
[[QUANTITY]] [[QUANTITYWITH]] [[NUMVAL]] [[NUMVALWITH]] [[VAL]] [[VALWITH]] [[AVAL]] [[AVALWITH]] [[UNITWITH]]
}}
}}
[[Category:Evaluation]]
[[Category:Evaluation]]

Latest revision as of 19:24, 15 October 2018

Syntax

UNIT ( expression )


Implemented in iMath since version 2.2.0 or earlier.

Explanation

Try to find a quantity (number with optional units) for the expression from any equations defined previously in the document, and then get the units of this result. Gives an error if the expression does not evaluate to a quantity.


Example

EQDEF a = 3 x

EQDEF b = 2 x

EQDEF x = 7 %metre

EXDEF UNIT(a + b)

This will output "m".

See also

QUANTITY QUANTITYWITH NUMVAL NUMVALWITH VAL VALWITH AVAL AVALWITH UNITWITH