QUANTITY: Difference between revisions

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

Revision as of 07:12, 1 July 2017

Syntax

QUANTITY ( 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. 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 UNIT UNITWITH