moros/www/calculator.html

52 lines
1.1 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>MOROS Calculator</title>
<link rel="stylesheet" type="text/css" href="moros.css">
</head>
<body>
<h1>MOROS Calculator</h1>
<p>A calculator is available in MOROS using double-precision binary floating-point
format (binary64).</p>
<p>It can be invocked from the shell through the command <code>calc</code> with an operation
to perform in arguments:</p>
<pre><code>&gt; calc 2 + 2
4
</code></pre>
<p>And it will open a REPL if no arguments are provided:</p>
<pre><code>&gt; calc
MOROS Calc v0.1.0
&gt; 2 + 2
4
</code></pre>
<p>The following arithmetic operations are supported:</p>
<ul>
<li><code>+</code> addition</li>
<li><code>-</code> subtraction</li>
<li><code>*</code> multiplication</li>
<li><code>/</code> division</li>
<li><code>%</code> modulo</li>
<li><code>^</code> exponential</li>
</ul>
<p>Parentheses <code>()</code> can change the order of operations:</p>
<pre><code>&gt; 2 + 3 * 4
14
&gt; (2 + 3) * 4
20
</code></pre>
<footer><p><a href="/">MOROS</a></footer>
</body>
</html>