1<?xml version="1.0" encoding="utf-8"?> 2<page xmlns="http://projectmallard.org/1.0/" type="guide" id="variable" xml:lang="nn"> 3 4 <info> 5 <link type="guide" xref="index#equation"/> 6 </info> 7 8 <title>Variables</title> 9 10 <p> 11 To assign a value to a variable use the = symbol or choose the variable to assign to with the <gui>x</gui> button in <link xref="mouse">advanced mode</link>. 12 A variable name must only contain upper or lower characters. 13 </p> 14 <example> 15 <p> 16 x=5 17 </p> 18 <p> 19 value=82 20 </p> 21 </example> 22 <p> 23 Variables can be used in any equation and are substituted for their assigned value. 24 Variables can be inserted using the <gui>x</gui> button. 25 </p> 26 <example> 27 <p> 28 6x+3 29 </p> 30 <p> 31 xy−3x+7y−21 32 </p> 33 </example> 34 <p> 35 The following variables are always defined. 36 </p> 37 <table> 38 <tr> 39 <td><p>ans</p></td> 40 <td><p>Result of previous calculation</p></td> 41 </tr> 42 <tr> 43 <td><p>e</p></td> 44 <td><p><link xref="logarithm">Euler's Number</link></p></td> 45 </tr> 46 <tr> 47 <td><p>π</p></td> 48 <td><p><link xref="trigonometry">Pi</link></p></td> 49 </tr> 50 <tr> 51 <td><p>rand</p></td> 52 <td><p>Random value in the range [0,1] (changes on each read)</p></td> 53 </tr> 54 </table> 55</page> 56