QUANTITY: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
<code>QUANTITY ( [[expression]] )</code> | <code>QUANTITY ( [[expression]] )</code> | ||
| | | | ||
Try to find a quantity | Try to find a [[quantity]] for the expression from any equations defined previously in the document. Gives an error if the expression does not evaluate to a [[quantity]]. | ||
All numerical values will be converted to floating point numbers. If you do not want this, use <code>[[VAL]]</code> instead. | All numerical values will be converted to floating point numbers. If you do not want this, use <code>[[VAL]]</code> instead. | ||
Line 19: | Line 19: | ||
| | | | ||
4= | 4= | ||
[[QUANTITYWITH]] [[NUMVAL]] [[NUMVALWITH]] [[VAL]] [[VALWITH]] [[UNIT]] [[UNITWITH]] | [[QUANTITYWITH]] [[NUMVAL]] [[NUMVALWITH]] [[VAL]] [[VALWITH]] [[AVAL]] [[AVALWITH]] [[UNIT]] [[UNITWITH]] | ||
}} | }} | ||
[[Category:Evaluation]] | [[Category:Evaluation]] |
Latest revision as of 19:23, 15 October 2018
Syntax
QUANTITY ( expression )
Implemented in iMath since version 2.2.0 or earlier.
Explanation
Try to find a quantity for the expression from any equations defined previously in the document. Gives an error if the expression does not evaluate to a quantity.
All numerical values will be converted to floating point numbers. If you do not want this, use VAL
instead.
Example
EQDEF a = 3 x
EQDEF b = 2 x
EQDEF x = 7 %metre
EXDEF QUANTITY(a + b)
This will output 35 "m".
See also
QUANTITYWITH NUMVAL NUMVALWITH VAL VALWITH AVAL AVALWITH UNIT UNITWITH