Difference between revisions of "CONSTDEF"

From iMath
Jump to: navigation, search
(Created page with "{{Keyword | <code>@label@ { options } CONSTDEF [*] expression</code> |2= Define a constant. The expression most be of the form <code>symbol = expression</code>...")
 
Line 10: Line 10:
 
|3=
 
|3=
 
<code>@c0@ CONSTDEF c_0 = 299792458 {"m" over "s"}</code> defines the speed of light in a vacuum.
 
<code>@c0@ CONSTDEF c_0 = 299792458 {"m" over "s"}</code> defines the speed of light in a vacuum.
 +
|4=
 +
[[EQDEF]]
 
}}
 
}}
  
 
[[Category:Definition]]
 
[[Category:Definition]]

Revision as of 19:50, 26 June 2017

Syntax

@label@ { options } CONSTDEF [*] expression


Implemented in iMath since version 2.2.0 or earlier.

Explanation

Define a constant. The expression most be of the form symbol = expression, and it must evaluate to a quantity.

The starred form will suppress printing of the result.

Constants are not erased by CLEAREQUATIONS. This makes it possible to specify general constants only once in the file and reuse them for several different calculations.

Example

@c0@ CONSTDEF c_0 = 299792458 {"m" over "s"} defines the speed of light in a vacuum.

See also

EQDEF