VALWITH: Difference between revisions

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

Latest revision as of 19:10, 15 October 2018

Syntax

VALWITH ( expression, equation|equation list )


Implemented in iMath since version 2.2.0 or earlier.

Explanation

Try to find a value for the expression from any equations defined previously in the document, plus the equations given as the second argument. A value is expected to be a quantity, that is a number with optional units. If the expression cannot be reduced to a quantity, it will be reduced to numerical values as for as possible.

The expression will contain rational numbers, not floats, unless a conversion to a floating point number is required to obtain a quantity. This might be the case e.g. if the expression contains square roots of rational numbers. If you want to force a conversion to floats, use QUANTITY instead.


Example

EQDEF a = 3 x

EQDEF b = 2 x

EXDEF VALWITH(a + b, x = 7 %metre)

This will output 35 "m".

See also

QUANTITY QUANTITYWITH NUMVAL NUMVALWITH VAL AVAL AVALWITH UNIT UNITWITH