File: first_steps.html

package info (click to toggle)
speedcrunch 0.12.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 14,160 kB
  • sloc: cpp: 17,603; ansic: 14,719; python: 569; sh: 236; xml: 135; makefile: 23
file content (208 lines) | stat: -rw-r--r-- 13,868 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>First Steps</title>
    
    <link rel="stylesheet" href="../_static/quark.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="top" title="SpeedCrunch 0.12 documentation" href="../contents.html" />
    <link rel="up" title="User Guide" href="index.html" />
    <link rel="next" title="Syntax" href="syntax.html" />
    <link rel="prev" title="Installation" href="installation.html" /> 
  </head>
  <body role="document">
  <table class="navbar navbar-top">
    
  <tr>
    <td width="50%">
      <a class="nav-item nav-item-0" 
         href="../contents.html">SpeedCrunch 0.12 documentation</a> &#187; <a class="nav-item nav-item-1"
             href="index.html">User Guide</a>
          
    </td>

    <td align="right" width="50%">
      <a class="rel-item rel-item-1"
           href="installation.html"
           title="Installation"
           accesskey="P">previous</a>
         | 
      <a class="rel-item rel-item-2"
           href="syntax.html"
           title="Syntax"
           accesskey="N">next</a>
         | 
      <a class="rel-item rel-item-3"
           href="../sc-functionindex.html"
           title="Function Index"
           >functions</a>
         | 
      <a class="rel-item rel-item-4"
           href="../genindex.html"
           title="General Index"
           accesskey="I">index</a>
        
      
    </td>

  </tr>

  </table>


    <div class="document">
      <div class="documentwrapper">
          <div class="body" role="main">
            
  <div class="section" id="first-steps">
<h1>First Steps</h1>
<p>SpeedCrunch is designed to be used via the keyboard. While an <a class="reference internal" href="interface.html#keypad"><span class="std std-ref">on-screen keypad</span></a> is available,
it is disabled by default. The powerful keyboard interface is the recommended way to
use SpeedCrunch to get the most out of it. However, the keypad can be enabled from:
<span class="menuselection">View ‣ Keypad</span>.</p>
<table class="-x-quark-box -x-quark-admonition -x-quark-note"><tbody><tr><td width="100%" class="-x-quark-box-td"><div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">All examples in this manual use a period (<code class="docutils literal"><span class="pre">.</span></code>) as the decimal separator. By default,
SpeedCrunch will use your system&#8217;s default decimal separator for output and will
accept both a period and a comma (<code class="docutils literal"><span class="pre">,</span></code>) for input (<a class="reference internal" href="interface.html#radix-character"><span class="std std-ref">more details</span></a>).
Depending on your settings, it may be necessary to replace the periods with the
appropriate decimal separator when entering these examples into SpeedCrunch.</p>
</div>
</td></tr></tbody></table><p>When starting SpeedCrunch for the first time, the interface may thus seem a little plain. Don&#8217;t be fooled, it can easily be customized. At the bottom edge of the window, you see the the <strong>input bar</strong>, also called the <strong>editor</strong>, with a blinking cursor showing that it is ready to accept keystrokes. To try out SpeedCrunch, type:</p>
<table class="-x-quark-literal-block"><tbody><tr><td width="100%" class="-x-quark-literal-block-td"><div class="highlight-speedcrunch"><div class="highlight"><pre><span class="mf">1.234 </span><span class="o">+</span> <span class="mf">7.89</span>
</pre></div>
</div>
</td></tr></tbody></table><p>then hit <code class="kbd docutils literal"><span class="pre">Enter</span></code> to evaluate the expression. The result (along with the expression you just entered) will be displayed at the top of window:</p>
<table class="-x-quark-literal-block"><tbody><tr><td width="100%" class="-x-quark-literal-block-td"><div class="highlight-speedcrunch"><div class="highlight"><pre><span class="mf">1.234 </span><span class="o">+</span> <span class="mf">7.89</span><span class="ge"></span>
<span class="ge">= 9.124</span>
</pre></div>
</div>
</td></tr></tbody></table><p>This region (called the <strong>result window</strong>) not only shows the result of your last calculation, it is a complete browsable history. Any previous input or result can be recalled by double-clicking the corresponding line.</p>
<p>Let&#8217;s try this out. First, perform some more calculations so that more than one entry is displayed in the result window:</p>
<table class="-x-quark-literal-block"><tbody><tr><td width="100%" class="-x-quark-literal-block-td"><div class="highlight-speedcrunch"><div class="highlight"><pre><span class="mi">54</span><span class="o">*</span><span class="mf">4.514 </span><span class="o">+</span> <span class="mi">57</span><span class="ge"></span>
<span class="ge">= 300.756</span>

<span class="mi">54</span><span class="o">*</span><span class="p">(</span><span class="mf">4.514 </span><span class="o">-</span> <span class="mf">5.7</span><span class="p">)</span><span class="ge"></span>
<span class="ge">= -64.044</span>
</pre></div>
</div>
</td></tr></tbody></table><p>Note how multiplication (<code class="docutils literal"><span class="pre">*</span></code>) takes precedence over addition (<code class="docutils literal"><span class="pre">+</span></code>) unless parentheses are used to specify a particular order of evaluation. If you now wish to continue working with one of the results, double-click e.g. the line <code class="docutils literal"><span class="pre">=</span> <span class="pre">300.756</span></code>. The input bar will be populated with this result. Similarly, you can also quickly recall previous input by double-clicking them in the result history. Alternatively, you can use the <code class="kbd docutils literal"><span class="pre">Up</span></code> and <code class="kbd docutils literal"><span class="pre">Down</span></code> arrow keys on your keyboard to recall previous expressions or use the mouse wheel for the same effect (the mouse cursor must be hovering over the editor for this to work, otherwise the result window will be scrolled).</p>
<p>To continue the computation directly from the previous result, you can use the special variable <code class="docutils literal"><span class="pre">ans</span></code> which always holds the result of the last entry in the history. Try this:</p>
<table class="-x-quark-literal-block"><tbody><tr><td width="100%" class="-x-quark-literal-block-td"><div class="highlight-speedcrunch"><div class="highlight"><pre><span class="mi">2</span><span class="o">+</span><span class="mi">3         </span><span class="c">? By the way, you can use question marks for comments.</span>
<span class="o">=</span> <span class="mi">5</span>

<span class="mi">7</span><span class="o">*</span><span class="no">ans</span>       <span class="c">? &#39;ans&#39; is now equal to 5</span>
<span class="o">=</span> <span class="mi">35</span>

<span class="no">ans</span> <span class="o">+</span> <span class="mi">300</span><span class="ge"></span>
<span class="ge">= 38</span>
</pre></div>
</div>
</td></tr></tbody></table><p>As you can see, <code class="docutils literal"><span class="pre">ans</span></code> provides a quick and easy way to access the previous result. Sometimes,
SpeedCrunch can even insert <code class="docutils literal"><span class="pre">ans</span></code> for you: When you start a new expression with an operator (e.g. <code class="docutils literal"><span class="pre">+</span></code>, <code class="docutils literal"><span class="pre">-</span></code>, <code class="docutils literal"><span class="pre">*</span></code>, <code class="docutils literal"><span class="pre">/</span></code>, <code class="docutils literal"><span class="pre">^</span></code>), <code class="docutils literal"><span class="pre">ans</span></code> will be prepended automatically. <a class="footnote-reference" href="#f1" id="id1">[1]</a> To try it out, type <code class="docutils literal"><span class="pre">7</span></code> <code class="kbd docutils literal"><span class="pre">Enter</span></code> <code class="docutils literal"><span class="pre">+3</span></code> <code class="kbd docutils literal"><span class="pre">Enter</span></code>.
SpeedCrunch expands this as follows:</p>
<table class="-x-quark-literal-block"><tbody><tr><td width="100%" class="-x-quark-literal-block-td"><div class="highlight-speedcrunch"><div class="highlight"><pre><span class="mi">7</span><span class="ge"></span>
<span class="ge">= 7</span>

<span class="no">ans</span><span class="o">+</span><span class="mi">3</span><span class="ge"></span>
<span class="ge">= 10</span>
</pre></div>
</div>
</td></tr></tbody></table><p>SpeedCrunch comes with a number of <a class="reference internal" href="../reference/constants.html#constants"><span class="std std-ref">mathematical constants</span></a> like π that are available by typing their name:</p>
<table class="-x-quark-literal-block"><tbody><tr><td width="100%" class="-x-quark-literal-block-td"><div class="highlight-speedcrunch"><div class="highlight"><pre><span class="no">pi</span><span class="ge"></span>
<span class="ge">= 3.14159265358979323846</span>

<span class="no">pi</span><span class="o">*</span><span class="mf">1.2</span><span class="o">^</span><span class="mi">2</span><span class="ge"></span>
<span class="ge">= 4.52389342116930226339</span>
</pre></div>
</div>
</td></tr></tbody></table><p>Let us finish this short introduction with a word about functions. SpeedCrunch comes with an extensive list of built-in mathematical functions which can be accessed by simply typing their name in the editor followed by any parameters (also called arguments) in parentheses:</p>
<table class="-x-quark-literal-block"><tbody><tr><td width="100%" class="-x-quark-literal-block-td"><div class="highlight-speedcrunch"><div class="highlight"><pre><span class="n">sqrt</span><span class="p">(</span><span class="mi">144</span><span class="p">)</span><span class="ge"></span>
<span class="ge">= 12</span>
</pre></div>
</div>
</td></tr></tbody></table><p>The function <a class="reference internal" href="../reference/basic.html#sc.sqrt" title="sqrt"><code class="xref sc sc-func docutils literal"><span class="pre">sqrt()</span></code></a> calculates the square root of its argument. Some functions require or accept more than one argument. In that case, separate them with a semicolon (<code class="docutils literal"><span class="pre">;</span></code>).</p>
<table class="-x-quark-box -x-quark-admonition -x-quark-warning"><tbody><tr><td width="100%" class="-x-quark-box-td"><div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">To repeat: In contrast to many programming languages, parameters in SpeedCrunch are separated by a <strong>semicolon</strong>!</p>
</div>
</td></tr></tbody></table><p>An example is the <a class="reference internal" href="../reference/statistical.html#sc.average" title="average"><code class="xref sc sc-func docutils literal"><span class="pre">average()</span></code></a> function:</p>
<table class="-x-quark-literal-block"><tbody><tr><td width="100%" class="-x-quark-literal-block-td"><div class="highlight-speedcrunch"><div class="highlight"><pre><span class="n">average</span><span class="p">(</span><span class="mi">12</span><span class="p">;</span><span class="mi">34</span><span class="p">;</span><span class="mi">56</span><span class="p">)</span><span class="ge"></span>
<span class="ge">= 34</span>
</pre></div>
</div>
</td></tr></tbody></table><p>This is already enough to use SpeedCrunch effectively. Try it out for yourself! Alternatively,
read on to learn about its more advanced features.</p>
<p class="rubric">Footnotes</p>
<div id="f1" class="-x-quark-footnote-wrapper"><table class="docutils footnote" frame="void" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>This requires that the <a class="reference internal" href="interface.html#automatic-result-reuse"><span class="std std-ref">Automatic Result Reuse</span></a> setting
is enabled.</td></tr>
</tbody>
</table>
</div></div>


          </div>
      </div>
      <div class="clearer"></div>
    </div>
  <table class="navbar navbar-bottom">
    
  <tr>
    <td width="50%">
      <a class="nav-item nav-item-0" 
         href="../contents.html">SpeedCrunch 0.12 documentation</a> &#187; <a class="nav-item nav-item-1"
             href="index.html">User Guide</a>
          
    </td>

    <td align="right" width="50%">
      <a class="rel-item rel-item-1"
           href="installation.html"
           title="Installation"
           >previous</a>
         | 
      <a class="rel-item rel-item-2"
           href="syntax.html"
           title="Syntax"
           >next</a>
         | 
      <a class="rel-item rel-item-3"
           href="../sc-functionindex.html"
           title="Function Index"
           >functions</a>
         | 
      <a class="rel-item rel-item-4"
           href="../genindex.html"
           title="General Index"
           >index</a>
        
      
    </td>

  </tr>

    <tr>
      <td colspan="2" align="center">
        
    <div class="footer" role="contentinfo">
        &#169; Copyright 2016, The SpeedCrunch Developers.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.
    </div>
      </td>
    </tr>
  </table>

  </body>
</html>