hp/docs/fpm-ford/proc/apply_command.html
2023-06-09 19:14:39 -04:00

1085 lines
No EOL
112 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="RPN calculator in modern Fortran">
<meta name="author" content="sgeard" >
<link rel="icon" href="../favicon.png">
<title>apply_command &ndash; hp</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/pygments.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/local.css" rel="stylesheet">
<link href="../tipuesearch/tipuesearch.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="../js/jquery-2.1.3.min.js"></script>
<script src="../js/svg-pan-zoom.min.js"></script>
</head>
<body>
<!-- Fixed navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">hp </a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown hidden-xs visible-sm visible-md hidden-lg">
<a href="#" class="dropdown-toggle"
data-toggle="dropdown" role="button"
aria-haspopup="true"
aria-expanded="false">Contents <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="../lists/files.html">Source Files</a></li>
<li><a href="../lists/modules.html">Modules</a></li>
<li><a href="../lists/procedures.html">Procedures</a></li>
<li><a href="../lists/absint.html">Abstract Interfaces</a></li>
<li><a href="../lists/types.html">Derived Types</a></li>
<li><a href="../lists/programs.html">Programs</a></li>
</ul>
</li>
<li class="visible-xs hidden-sm visible-lg"><a href="../lists/files.html">Source Files</a></li>
<li class="visible-xs hidden-sm visible-lg"><a href="../lists/modules.html">Modules</a></li>
<li class="visible-xs hidden-sm visible-lg"><a href="../lists/procedures.html">Procedures</a></li>
<li class="visible-xs hidden-sm visible-lg"><a href="../lists/absint.html">Abstract Interfaces</a></li>
<li class="visible-xs hidden-sm visible-lg"><a href="../lists/types.html">Derived Types</a></li>
<li class="visible-xs hidden-sm visible-lg"><a href="../lists/programs.html">Programs</a></li>
</ul>
<form action="../search.html" class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search" name="q" id="tipue_search_input" autocomplete="off" required>
</div>
<!--
<button type="submit" class="btn btn-default">Submit</button>
-->
</form>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container">
<div class="row">
<h1>apply_command
<small>Subroutine</small>
</h1>
<div class="row" id="info-bar">
<div class="col-lg-12">
<div class="well well-sm">
<ul class="list-inline" style="margin-bottom:0px;display:inline">
<li id="statements"><i class="fa fa-list-ol"></i>
<a data-toggle="tooltip"
data-placement="bottom" data-html="true"
title=" 3.4% of total for procedures.">386 statements</a>
</li>
<li id="source-file">
<i class="fa fa-code"></i>
<a href="../src/main.f90"> Source File</a>
</li>
</ul>
<ol class="breadcrumb in-well text-right">
<li><a href='../sourcefile/main.f90.html'>main.f90</a></li>
<li><a href='../program/hp15c.html'>hp15c</a></li>
<li class="active">apply_command</li>
</ol>
</div>
</div>
</div>
<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
</div>
<div class="row">
<div class="col-md-3 hidden-xs hidden-sm visible-md visible-lg">
<div id="sidebar">
<h3>Contents</h3>
<div class="panel panel-primary">
<div class="panel-heading text-left">
<h3 class="panel-title">
<a data-toggle="collapse" href="#vars-0">Variables</a>
</h3>
</div>
<div id="vars-0" class="panel-collapse collapse">
<div class="list-group">
<a class="list-group-item" href="../proc/apply_command.html#variable-ang">ang</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-comma">comma</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-idx~5">idx</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-im">im</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-is_cart~2">is_cart</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-lang~2">lang</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-m~2">m</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-r~67">r</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-tmp_seq">tmp_seq</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-u">u</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-us">us</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-z~6">z</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-zs">zs</a>
</div>
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
<div class="list-group">
<a class="list-group-item" href="../proc/apply_command.html#src">apply_command</a>
</div>
</div>
</div>
</div>
<div class="col-md-9" id='text'>
<h2> subroutine apply_command(command, ok)
</h2>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Uses</h3>
</div>
<ul class="list-group">
<li class="list-group-item">
<ul class="list-inline">
<li><a href="http://fortranwiki.org/fortran/show/ieee_arithmetic">ieee_arithmetic</a></li>
</ul>
</li>
</ul>
</div>
<h3>Arguments</h3>
<table class="table table-striped varlist">
<thead>
<tr>
<th>Type</th>
<th>Intent</th><th>Optional</th> <th>Attributes</th>
<th></th>
<th>Name</th>
<th></th>
</thead>
<tbody>
<tr>
<td>
<span class="anchor" id="variable-command~3"></span>
character,
</td>
<td>intent(in)</td>
<td></td> <td>
</td>
<td>::</td>
<td><strong>command</strong></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-ok~2"></span>
logical,
</td>
<td>intent(out)</td>
<td></td> <td>
</td>
<td>::</td>
<td><strong>ok</strong></td>
<td>
</td>
</tr>
</tbody>
</table>
<br>
<section class="visible-xs visible-sm hidden-md">
<h3>Contents</h3>
<div class="panel panel-primary">
<div class="panel-heading text-left">
<h3 class="panel-title">
<a data-toggle="collapse" href="#vars-1">Variables</a>
</h3>
</div>
<div id="vars-1" class="panel-collapse collapse">
<div class="list-group">
<a class="list-group-item" href="../proc/apply_command.html#variable-ang">ang</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-comma">comma</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-idx~5">idx</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-im">im</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-is_cart~2">is_cart</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-lang~2">lang</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-m~2">m</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-r~67">r</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-tmp_seq">tmp_seq</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-u">u</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-us">us</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-z~6">z</a>
<a class="list-group-item" href="../proc/apply_command.html#variable-zs">zs</a>
</div>
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
<div class="list-group">
<a class="list-group-item" href="../proc/apply_command.html#src">apply_command</a>
</div>
</div>
</section>
<br class="visible-xs visible-sm hidden-md">
<section>
<h2>Variables</h2>
<table class="table table-striped varlist">
<thead>
<tr>
<th>Type</th>
<th>Visibility</th> <th>Attributes</th>
<th></th>
<th>Name</th>
<th></th><th>Initial</th> <th></th>
</thead>
<tbody>
<tr>
<td>
<span class="anchor" id="variable-ang"></span>
real(kind=8),
</td>
<td>public</td>
<td>
</td>
<td>::</td>
<td><strong>ang</strong></td>
<td></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-comma"></span>
character(len=1),
</td>
<td>public</td>
<td>
</td>
<td>::</td>
<td><strong>comma</strong></td>
<td></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-idx~5"></span>
integer,
</td>
<td>public</td>
<td>
</td>
<td>::</td>
<td><strong>idx</strong></td>
<td></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-im"></span>
real(kind=8),
</td>
<td>public</td>
<td>
</td>
<td>::</td>
<td><strong>im</strong></td>
<td></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-is_cart~2"></span>
logical,
</td>
<td>public</td>
<td>
</td>
<td>::</td>
<td><strong>is_cart</strong></td>
<td></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-lang~2"></span>
character(len=5),
</td>
<td>public,</td>
<td>
parameter
</td>
<td>::</td>
<td><strong>lang</strong>(2)</td>
<td> =</td>
<td>['POINT', 'COMMA']</td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-m~2"></span>
integer,
</td>
<td>public</td>
<td>
</td>
<td>::</td>
<td><strong>m</strong></td>
<td></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-r~67"></span>
real(kind=8),
</td>
<td>public</td>
<td>
</td>
<td>::</td>
<td><strong>r</strong></td>
<td></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-tmp_seq"></span>
real(kind=8),
</td>
<td>public,</td>
<td>
allocatable
</td>
<td>::</td>
<td><strong>tmp_seq</strong>(:)</td>
<td></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-u"></span>
complex(kind=8),
</td>
<td>public</td>
<td>
</td>
<td>::</td>
<td><strong>u</strong></td>
<td></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-us"></span>
type(<a href='../type/rpn_t.html'>rpn_t</a>),
</td>
<td>public</td>
<td>
</td>
<td>::</td>
<td><strong>us</strong></td>
<td></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-z~6"></span>
complex(kind=8),
</td>
<td>public</td>
<td>
</td>
<td>::</td>
<td><strong>z</strong></td>
<td></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="anchor" id="variable-zs"></span>
type(<a href='../type/rpn_t.html'>rpn_t</a>),
</td>
<td>public</td>
<td>
</td>
<td>::</td>
<td><strong>zs</strong></td>
<td></td>
<td></td>
<td>
</td>
</tr>
</tbody>
</table>
</section>
<br>
<section>
<h2><span class="anchor" id="src"></span>Source Code</h2>
<div class="highlight"><pre><span></span><span class="w"> </span><span class="k">subroutine </span><span class="n">apply_command</span><span class="p">(</span><span class="n">command</span><span class="p">,</span><span class="w"> </span><span class="n">ok</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">use</span><span class="p">,</span><span class="w"> </span><span class="k">intrinsic</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">ieee_arithmetic</span><span class="w"></span>
<span class="w"> </span><span class="k">implicit none</span>
<span class="k"> </span><span class="kt">character</span><span class="p">(</span><span class="o">*</span><span class="p">),</span><span class="w"> </span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">command</span><span class="w"></span>
<span class="w"> </span><span class="kt">logical</span><span class="p">,</span><span class="w"> </span><span class="k">intent</span><span class="p">(</span><span class="n">out</span><span class="p">)</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">ok</span><span class="w"></span>
<span class="w"> </span><span class="kt">real</span><span class="p">(</span><span class="mi">8</span><span class="p">)</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">r</span><span class="p">,</span><span class="w"> </span><span class="n">im</span><span class="p">,</span><span class="w"> </span><span class="n">ang</span><span class="w"></span>
<span class="w"> </span><span class="kt">complex</span><span class="p">(</span><span class="mi">8</span><span class="p">)</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">u</span><span class="p">,</span><span class="w"> </span><span class="n">z</span><span class="w"></span>
<span class="w"> </span><span class="kt">real</span><span class="p">(</span><span class="mi">8</span><span class="p">),</span><span class="w"> </span><span class="k">allocatable</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">tmp_seq</span><span class="p">(:)</span><span class="w"></span>
<span class="w"> </span><span class="k">type</span><span class="p">(</span><span class="n">rpn_t</span><span class="p">)</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">us</span><span class="p">,</span><span class="w"> </span><span class="n">zs</span><span class="w"></span>
<span class="w"> </span><span class="kt">logical</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">is_cart</span><span class="w"></span>
<span class="w"> </span><span class="kt">integer</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">m</span><span class="p">,</span><span class="w"> </span><span class="n">idx</span><span class="w"></span>
<span class="w"> </span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">comma</span><span class="w"></span>
<span class="w"> </span><span class="kt">character</span><span class="p">(</span><span class="mi">5</span><span class="p">),</span><span class="w"> </span><span class="k">parameter</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">lang</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="s1">&#39;POINT&#39;</span><span class="p">,</span><span class="s1">&#39;COMMA&#39;</span><span class="p">]</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="n">ok</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">.</span><span class="n">true</span><span class="p">.</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nb">len_trim</span><span class="p">(</span><span class="n">command</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> return</span>
<span class="k"> end if</span>
<span class="k"> </span>
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">verbosity</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> write</span><span class="p">(</span><span class="o">*</span><span class="p">,</span><span class="s1">&#39;(a)&#39;</span><span class="p">)</span><span class="w"> </span><span class="s1">&#39;Applying: &#39;</span><span class="o">//</span><span class="n">command</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> </span>
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">in_sequence</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">command</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s1">&#39;}&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">in_sequence</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">2</span><span class="w"></span>
<span class="w"> </span><span class="n">complex_mode</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tmp_cmode</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">calculate_stats</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">else</span><span class="w"></span>
<span class="w"> </span><span class="c">! All elements must be the same so either all x or all x,y</span>
<span class="w"> </span><span class="n">idx</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">index</span><span class="p">(</span><span class="n">command</span><span class="p">,</span><span class="s1">&#39;,&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">n_seq</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">seq_is_x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">idx</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">seq_is_x</span><span class="w"> </span><span class="p">.</span><span class="n">neqv</span><span class="p">.</span><span class="w"> </span><span class="p">(</span><span class="n">idx</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">))</span><span class="w"> </span><span class="k">then</span>
<span class="k"> goto</span><span class="w"> </span><span class="mi">901</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">seq_is_x</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> read</span><span class="p">(</span><span class="n">command</span><span class="p">,</span><span class="o">*</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">r</span><span class="w"></span>
<span class="w"> </span><span class="n">im</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> read</span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="mi">1</span><span class="p">:</span><span class="n">idx</span><span class="o">-</span><span class="mi">1</span><span class="p">),</span><span class="o">*</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">r</span><span class="w"></span>
<span class="w"> </span><span class="k">read</span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="n">idx</span><span class="o">+</span><span class="mi">1</span><span class="p">:</span><span class="nb">len</span><span class="p">(</span><span class="n">command</span><span class="p">)),</span><span class="o">*</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">im</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span><span class="w"></span>
<span class="w"> </span><span class="c">! Initial allocation</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">n_seq</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="p">.</span><span class="nb">and</span><span class="p">.</span><span class="w"> </span><span class="p">.</span><span class="nb">not</span><span class="p">.</span><span class="w"> </span><span class="nb">allocated</span><span class="p">(</span><span class="n">x_seq</span><span class="p">))</span><span class="w"> </span><span class="k">then</span>
<span class="k"> allocate</span><span class="p">(</span><span class="n">x_seq</span><span class="p">(</span><span class="mi">10</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(.</span><span class="nb">not</span><span class="p">.</span><span class="w"> </span><span class="n">seq_is_x</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> allocate</span><span class="p">(</span><span class="n">y_seq</span><span class="p">(</span><span class="mi">10</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> end if</span>
<span class="k"> </span>
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">n_seq</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">size</span><span class="p">(</span><span class="n">x_seq</span><span class="p">))</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">n_seq</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">n_seq</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">1</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span><span class="w"></span>
<span class="w"> </span><span class="c">! Expand array</span>
<span class="w"> </span><span class="k">allocate</span><span class="p">(</span><span class="n">tmp_seq</span><span class="p">(</span><span class="n">n_seq</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">10</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="n">tmp_seq</span><span class="p">(</span><span class="mi">1</span><span class="p">:</span><span class="n">n_seq</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">x_seq</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="nb">move_alloc</span><span class="p">(</span><span class="n">tmp_seq</span><span class="p">,</span><span class="w"> </span><span class="n">x_seq</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(.</span><span class="nb">not</span><span class="p">.</span><span class="w"> </span><span class="n">seq_is_x</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> allocate</span><span class="p">(</span><span class="n">tmp_seq</span><span class="p">(</span><span class="n">n_seq</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">10</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="n">tmp_seq</span><span class="p">(</span><span class="mi">1</span><span class="p">:</span><span class="n">n_seq</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">y_seq</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="nb">move_alloc</span><span class="p">(</span><span class="n">tmp_seq</span><span class="p">,</span><span class="w"> </span><span class="n">y_seq</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> end if</span>
<span class="k"> </span><span class="n">x_seq</span><span class="p">(</span><span class="n">n_seq</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">r</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(.</span><span class="nb">not</span><span class="p">.</span><span class="w"> </span><span class="n">seq_is_x</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">y_seq</span><span class="p">(</span><span class="n">n_seq</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">im</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">verbosity</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> print</span><span class="w"> </span><span class="o">*</span><span class="p">,</span><span class="n">x_seq</span><span class="p">(</span><span class="mi">1</span><span class="p">:</span><span class="n">n_seq</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> end if</span>
<span class="k"> return</span>
<span class="k"> end if</span>
<span class="k"> </span>
<span class="k"> select case</span><span class="p">(</span><span class="n">command</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;q&#39;</span><span class="p">,</span><span class="s1">&#39;quit&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">ok</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">.</span><span class="n">false</span><span class="p">.</span><span class="w"></span>
<span class="w"> </span><span class="k">return</span>
<span class="k"> </span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;=&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">ok</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">.</span><span class="n">false</span><span class="p">.</span><span class="w"></span>
<span class="w"> </span><span class="k">return</span>
<span class="k"> </span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;{&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="c">! Start sequence</span>
<span class="w"> </span><span class="n">in_sequence</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w"></span>
<span class="w"> </span><span class="n">n_seq</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
<span class="w"> </span><span class="n">tmp_cmode</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">complex_mode</span><span class="w"></span>
<span class="w"> </span><span class="n">complex_mode</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">.</span><span class="n">false</span><span class="p">.</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stats</span><span class="p">%</span><span class="n">clear</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;--&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">chs_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;^&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">push</span><span class="p">(</span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;+&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_binary</span><span class="p">(</span><span class="n">add_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;-&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_binary</span><span class="p">(</span><span class="n">subtract_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;*&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_binary</span><span class="p">(</span><span class="n">multiply_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_binary</span><span class="p">(</span><span class="n">divide_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;^x&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_binary</span><span class="p">(</span><span class="n">power_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;^/x&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="c">! Only raising to a real power is supported</span>
<span class="w"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">zs</span><span class="p">%</span><span class="n">is_real</span><span class="p">())</span><span class="w"> </span><span class="k">then</span>
<span class="k"> call </span><span class="n">invoke_binary</span><span class="p">(</span><span class="n">root_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> goto</span><span class="w"> </span><span class="mi">901</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> </span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;&gt;&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">next_root_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;&lt;&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">previous_root_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;%&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_binary</span><span class="p">(</span><span class="n">percent_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;xy&#39;</span><span class="p">,</span><span class="s1">&#39;XY&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">swap</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;R&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">rotate_down</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;r&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">rotate_up</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;CLA&#39;</span><span class="p">,</span><span class="s1">&#39;cla&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">clear</span><span class="w"></span>
<span class="w"> </span><span class="n">mem</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">rpn_t</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stats</span><span class="p">%</span><span class="n">clear</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;CL&#39;</span><span class="p">,</span><span class="s1">&#39;cl&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">clear</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;CLX&#39;</span><span class="p">,</span><span class="s1">&#39;clx&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">set</span><span class="p">(</span><span class="n">rpn_t</span><span class="p">())</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;_&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">complex_mode</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">conj_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">endif</span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;len&#39;</span><span class="p">,</span><span class="s1">&#39;||&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">complex_mode</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">len_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="c">! Length is always reported as (x,0) and marked is_cartesian</span>
<span class="w"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">zs</span><span class="p">%</span><span class="n">set_value</span><span class="p">(</span><span class="n">is_cartesian</span><span class="o">=</span><span class="p">.</span><span class="n">true</span><span class="p">.)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">set</span><span class="p">(</span><span class="n">zs</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">z</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">zs</span><span class="p">%</span><span class="n">get_value</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span><span class="n">us</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">u</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">us</span><span class="p">%</span><span class="n">get_value</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">zs</span><span class="p">%</span><span class="n">set_value</span><span class="p">(</span><span class="nb">cmplx</span><span class="p">(</span><span class="nb">hypot</span><span class="p">(</span><span class="n">z</span><span class="p">%</span><span class="n">re</span><span class="p">,</span><span class="n">u</span><span class="p">%</span><span class="n">re</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="mi">8</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">set</span><span class="p">(</span><span class="n">zs</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> </span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;split&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(.</span><span class="nb">not</span><span class="p">.</span><span class="w"> </span><span class="n">complex_mode</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">pop</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">zs</span><span class="p">%</span><span class="n">get_value</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">floor</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">ceiling</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> </span><span class="n">im</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">r</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">push</span><span class="p">(</span><span class="n">im</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">push</span><span class="p">(</span><span class="n">r</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> </span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;int&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(.</span><span class="nb">not</span><span class="p">.</span><span class="w"> </span><span class="n">complex_mode</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">zs</span><span class="p">%</span><span class="n">get_value</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">floor</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">ceiling</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> call </span><span class="n">zs</span><span class="p">%</span><span class="n">set_value</span><span class="p">(</span><span class="nb">cmplx</span><span class="p">(</span><span class="n">r</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">8</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">set</span><span class="p">(</span><span class="n">zs</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> </span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;nint&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(.</span><span class="nb">not</span><span class="p">.</span><span class="w"> </span><span class="n">complex_mode</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">zs</span><span class="p">%</span><span class="n">get_value</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">nint</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nb">mod</span><span class="p">(</span><span class="n">r</span><span class="p">,</span><span class="mf">2.0d0</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">r</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> call </span><span class="n">zs</span><span class="p">%</span><span class="n">set_value</span><span class="p">(</span><span class="nb">cmplx</span><span class="p">(</span><span class="n">r</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">8</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">set</span><span class="p">(</span><span class="n">zs</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> </span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;rem&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(.</span><span class="nb">not</span><span class="p">.</span><span class="w"> </span><span class="n">complex_mode</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">zs</span><span class="p">%</span><span class="n">get_value</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">floor</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">ceiling</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> </span><span class="n">im</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">r</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">zs</span><span class="p">%</span><span class="n">set_value</span><span class="p">(</span><span class="nb">cmplx</span><span class="p">(</span><span class="n">im</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">8</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">set</span><span class="p">(</span><span class="n">zs</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> </span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;drop&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">pop</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;ri&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="c">! Swap real and imaginary parts</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">complex_mode</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">swap_real_imaginary_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;to_pol&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="c">! Convert x + iy to r + i theta</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">complex_mode</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">set</span><span class="p">(</span><span class="n">to_polar</span><span class="p">(</span><span class="n">zs</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;to_cart&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="c">! Convert (r,theta) to (x,y)</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">complex_mode</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">set</span><span class="p">(</span><span class="n">to_cartesian</span><span class="p">(</span><span class="n">zs</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> </span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;1/&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">reciprocal_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;^2&#39;</span><span class="p">,</span><span class="s1">&#39;sq&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">power_2_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;^/2&#39;</span><span class="p">,</span><span class="s1">&#39;sqrt&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">sqrt_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;^3&#39;</span><span class="p">,</span><span class="s1">&#39;cb&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">power_3_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;^/3&#39;</span><span class="p">,</span><span class="s1">&#39;cbrt&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">cbrt_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;^*2&#39;</span><span class="p">,</span><span class="s1">&#39;alog2&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">exp_2_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;^*10&#39;</span><span class="p">,</span><span class="s1">&#39;alog10&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">exp_10_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;exp&#39;</span><span class="p">,</span><span class="s1">&#39;alog&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">exp_e_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;ln&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">ln_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;log2&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">log2_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;lg&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">lg_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;sinh&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">hsine_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;cosh&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">hcosine_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;tanh&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">htangent_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;sin&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">sine_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;cos&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">cosine_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;tan&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">tangent_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;asin&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">asine_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;asinh&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">ahsine_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;acos&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">acosine_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;acosh&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">ahcosine_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;atan&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">atangent_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;atanh&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">ahtangent_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;atan2&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_binary</span><span class="p">(</span><span class="n">atangent2_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;gamma&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">gamma_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;!&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">zs</span><span class="p">%</span><span class="n">is_positive_real</span><span class="p">())</span><span class="w"> </span><span class="k">then</span>
<span class="k"> call </span><span class="n">invoke_unary</span><span class="p">(</span><span class="n">fact_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> goto</span><span class="w"> </span><span class="mi">901</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;ncr&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">us</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">zs</span><span class="p">%</span><span class="n">is_positive_real</span><span class="p">()</span><span class="w"> </span><span class="p">.</span><span class="nb">and</span><span class="p">.</span><span class="w"> </span><span class="n">us</span><span class="p">%</span><span class="n">is_positive_real</span><span class="p">())</span><span class="w"> </span><span class="k">then</span>
<span class="k"> call </span><span class="n">invoke_binary</span><span class="p">(</span><span class="n">ncr_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> goto</span><span class="w"> </span><span class="mi">901</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;npr&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">us</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">zs</span><span class="p">%</span><span class="n">is_positive_real</span><span class="p">()</span><span class="w"> </span><span class="p">.</span><span class="nb">and</span><span class="p">.</span><span class="w"> </span><span class="n">us</span><span class="p">%</span><span class="n">is_positive_real</span><span class="p">())</span><span class="w"> </span><span class="k">then</span>
<span class="k"> call </span><span class="n">invoke_binary</span><span class="p">(</span><span class="n">npr_fr</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> goto</span><span class="w"> </span><span class="mi">901</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> </span>
<span class="k"> case</span><span class="p">(</span><span class="s1">&#39;m0+&#39;</span><span class="p">,</span><span class="s1">&#39;m1+&#39;</span><span class="p">,</span><span class="s1">&#39;m2+&#39;</span><span class="p">,</span><span class="s1">&#39;m3+&#39;</span><span class="p">,</span><span class="s1">&#39;m4+&#39;</span><span class="p">,</span><span class="s1">&#39;m5+&#39;</span><span class="p">,</span><span class="s1">&#39;m6+&#39;</span><span class="p">,</span><span class="s1">&#39;m7+&#39;</span><span class="p">,</span><span class="s1">&#39;m8+&#39;</span><span class="p">,</span><span class="s1">&#39;m9+&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">read</span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="mi">2</span><span class="p">:</span><span class="mi">2</span><span class="p">),</span><span class="s1">&#39;(i1)&#39;</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">m</span><span class="w"></span>
<span class="w"> </span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;m0-&#39;</span><span class="p">,</span><span class="s1">&#39;m1-&#39;</span><span class="p">,</span><span class="s1">&#39;m2-&#39;</span><span class="p">,</span><span class="s1">&#39;m3-&#39;</span><span class="p">,</span><span class="s1">&#39;m4-&#39;</span><span class="p">,</span><span class="s1">&#39;m5-&#39;</span><span class="p">,</span><span class="s1">&#39;m6-&#39;</span><span class="p">,</span><span class="s1">&#39;m7-&#39;</span><span class="p">,</span><span class="s1">&#39;m8-&#39;</span><span class="p">,</span><span class="s1">&#39;m9-&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">read</span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="mi">2</span><span class="p">:</span><span class="mi">2</span><span class="p">),</span><span class="s1">&#39;(i1)&#39;</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">m</span><span class="w"></span>
<span class="w"> </span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;m0*&#39;</span><span class="p">,</span><span class="s1">&#39;m1*&#39;</span><span class="p">,</span><span class="s1">&#39;m2*&#39;</span><span class="p">,</span><span class="s1">&#39;m3*&#39;</span><span class="p">,</span><span class="s1">&#39;m4*&#39;</span><span class="p">,</span><span class="s1">&#39;m5*&#39;</span><span class="p">,</span><span class="s1">&#39;m6*&#39;</span><span class="p">,</span><span class="s1">&#39;m7*&#39;</span><span class="p">,</span><span class="s1">&#39;m8*&#39;</span><span class="p">,</span><span class="s1">&#39;m9*&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">read</span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="mi">2</span><span class="p">:</span><span class="mi">2</span><span class="p">),</span><span class="s1">&#39;(i1)&#39;</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">m</span><span class="w"></span>
<span class="w"> </span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;m0/&#39;</span><span class="p">,</span><span class="s1">&#39;m1/&#39;</span><span class="p">,</span><span class="s1">&#39;m2/&#39;</span><span class="p">,</span><span class="s1">&#39;m3/&#39;</span><span class="p">,</span><span class="s1">&#39;m4/&#39;</span><span class="p">,</span><span class="s1">&#39;m5/&#39;</span><span class="p">,</span><span class="s1">&#39;m6/&#39;</span><span class="p">,</span><span class="s1">&#39;m7/&#39;</span><span class="p">,</span><span class="s1">&#39;m8/&#39;</span><span class="p">,</span><span class="s1">&#39;m9/&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">read</span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="mi">2</span><span class="p">:</span><span class="mi">2</span><span class="p">),</span><span class="s1">&#39;(i1)&#39;</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">m</span><span class="w"></span>
<span class="w"> </span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;st0&#39;</span><span class="p">,</span><span class="s1">&#39;st1&#39;</span><span class="p">,</span><span class="s1">&#39;st2&#39;</span><span class="p">,</span><span class="s1">&#39;st3&#39;</span><span class="p">,</span><span class="s1">&#39;st4&#39;</span><span class="p">,</span><span class="s1">&#39;st5&#39;</span><span class="p">,</span><span class="s1">&#39;st6&#39;</span><span class="p">,</span><span class="s1">&#39;st7&#39;</span><span class="p">,</span><span class="s1">&#39;st8&#39;</span><span class="p">,</span><span class="s1">&#39;st9&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">read</span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="mi">3</span><span class="p">:</span><span class="mi">3</span><span class="p">),</span><span class="s1">&#39;(i1)&#39;</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">m</span><span class="w"></span>
<span class="w"> </span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;sw0&#39;</span><span class="p">,</span><span class="s1">&#39;sw1&#39;</span><span class="p">,</span><span class="s1">&#39;sw2&#39;</span><span class="p">,</span><span class="s1">&#39;sw3&#39;</span><span class="p">,</span><span class="s1">&#39;sw4&#39;</span><span class="p">,</span><span class="s1">&#39;sw5&#39;</span><span class="p">,</span><span class="s1">&#39;sw6&#39;</span><span class="p">,</span><span class="s1">&#39;sw7&#39;</span><span class="p">,</span><span class="s1">&#39;sw8&#39;</span><span class="p">,</span><span class="s1">&#39;sw9&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">read</span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="mi">3</span><span class="p">:</span><span class="mi">3</span><span class="p">),</span><span class="s1">&#39;(i1)&#39;</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">m</span><span class="w"></span>
<span class="w"> </span><span class="n">zs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">%</span><span class="n">peek</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">set</span><span class="p">(</span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">zs</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;rc0&#39;</span><span class="p">,</span><span class="s1">&#39;rc1&#39;</span><span class="p">,</span><span class="s1">&#39;rc2&#39;</span><span class="p">,</span><span class="s1">&#39;rc3&#39;</span><span class="p">,</span><span class="s1">&#39;rc4&#39;</span><span class="p">,</span><span class="s1">&#39;rc5&#39;</span><span class="p">,</span><span class="s1">&#39;rc6&#39;</span><span class="p">,</span><span class="s1">&#39;rc7&#39;</span><span class="p">,</span><span class="s1">&#39;rc8&#39;</span><span class="p">,</span><span class="s1">&#39;rc9&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">read</span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="mi">3</span><span class="p">:</span><span class="mi">3</span><span class="p">),</span><span class="s1">&#39;(i1)&#39;</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">m</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">stack</span><span class="p">%</span><span class="n">push</span><span class="p">(</span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;cl0&#39;</span><span class="p">,</span><span class="s1">&#39;cl1&#39;</span><span class="p">,</span><span class="s1">&#39;cl2&#39;</span><span class="p">,</span><span class="s1">&#39;cl3&#39;</span><span class="p">,</span><span class="s1">&#39;cl4&#39;</span><span class="p">,</span><span class="s1">&#39;cl5&#39;</span><span class="p">,</span><span class="s1">&#39;cl6&#39;</span><span class="p">,</span><span class="s1">&#39;cl7&#39;</span><span class="p">,</span><span class="s1">&#39;cl8&#39;</span><span class="p">,</span><span class="s1">&#39;cl9&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">read</span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="mi">3</span><span class="p">:</span><span class="mi">3</span><span class="p">),</span><span class="s1">&#39;(i1)&#39;</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">m</span><span class="w"></span>
<span class="w"> </span><span class="n">mem</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">rpn_t</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;msh&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">write</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="s1">&#39;(i3,a,dt)&#39;</span><span class="p">)</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="p">,</span><span class="s1">&#39;: &#39;</span><span class="p">,</span><span class="n">mem</span><span class="p">(</span><span class="n">i</span><span class="p">),</span><span class="n">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span><span class="n">size</span><span class="p">(</span><span class="n">mem</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;fix0&#39;</span><span class="p">,</span><span class="s1">&#39;fix1&#39;</span><span class="p">,</span><span class="s1">&#39;fix2&#39;</span><span class="p">,</span><span class="s1">&#39;fix3&#39;</span><span class="p">,</span><span class="s1">&#39;fix4&#39;</span><span class="p">,</span><span class="s1">&#39;fix5&#39;</span><span class="p">,</span><span class="s1">&#39;fix6&#39;</span><span class="p">,</span><span class="s1">&#39;fix7&#39;</span><span class="p">,</span><span class="s1">&#39;fix8&#39;</span><span class="p">,</span><span class="s1">&#39;fix9&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">read</span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="mi">4</span><span class="p">:</span><span class="mi">4</span><span class="p">),</span><span class="s1">&#39;(i1)&#39;</span><span class="p">)</span><span class="w"> </span><span class="n">m</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">set_places</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;DEG&#39;</span><span class="p">,</span><span class="s1">&#39;deg&#39;</span><span class="p">,</span><span class="s1">&#39;DEGREES&#39;</span><span class="p">,</span><span class="s1">&#39;degrees&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">toggle_degrees_mode</span><span class="p">(.</span><span class="n">true</span><span class="p">.)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;RAD&#39;</span><span class="p">,</span><span class="s1">&#39;rad&#39;</span><span class="p">,</span><span class="s1">&#39;RADIANS&#39;</span><span class="p">,</span><span class="s1">&#39;radians&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">toggle_degrees_mode</span><span class="p">(.</span><span class="n">false</span><span class="p">.)</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;mC&#39;</span><span class="p">,</span><span class="s1">&#39;COMPLEX&#39;</span><span class="p">,</span><span class="s1">&#39;complex&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">complex_mode</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">.</span><span class="n">true</span><span class="p">.</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;mR&#39;</span><span class="p">,</span><span class="s1">&#39;REAL&#39;</span><span class="p">,</span><span class="s1">&#39;real&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">complex_mode</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">.</span><span class="n">false</span><span class="p">.</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;mV&#39;</span><span class="p">,</span><span class="s1">&#39;VERBOSE&#39;</span><span class="p">,</span><span class="s1">&#39;verbose&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">veMode</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">.</span><span class="n">true</span><span class="p">.</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;mT&#39;</span><span class="p">,</span><span class="s1">&#39;TERSE&#39;</span><span class="p">,</span><span class="s1">&#39;terse&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">veMode</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">.</span><span class="n">false</span><span class="p">.</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;?&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">write</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="n">advance</span><span class="o">=</span><span class="s1">&#39;no&#39;</span><span class="p">,</span><span class="n">fmt</span><span class="o">=</span><span class="s1">&#39;(a)&#39;</span><span class="p">)</span><span class="w"> </span><span class="s1">&#39;Status: &#39;</span><span class="w"></span>
<span class="w"> </span><span class="k">write</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="n">advance</span><span class="o">=</span><span class="s1">&#39;no&#39;</span><span class="p">,</span><span class="n">fmt</span><span class="o">=</span><span class="s1">&#39;(2a)&#39;</span><span class="p">)</span><span class="w"> </span><span class="nb">merge</span><span class="p">(</span><span class="s1">&#39;degrees&#39;</span><span class="p">,</span><span class="s1">&#39;radians&#39;</span><span class="p">,</span><span class="n">degrees_mode</span><span class="p">),</span><span class="s1">&#39; ; &#39;</span><span class="w"></span>
<span class="w"> </span><span class="k">write</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="n">advance</span><span class="o">=</span><span class="s1">&#39;no&#39;</span><span class="p">,</span><span class="n">fmt</span><span class="o">=</span><span class="s1">&#39;(a,i0)&#39;</span><span class="p">)</span><span class="w"> </span><span class="s1">&#39;dp = &#39;</span><span class="p">,</span><span class="n">get_places</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">complex_mode</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> write</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="n">advance</span><span class="o">=</span><span class="s1">&#39;no&#39;</span><span class="p">,</span><span class="n">fmt</span><span class="o">=</span><span class="s1">&#39;(a)&#39;</span><span class="p">)</span><span class="w"> </span><span class="s1">&#39; ; mode = complex&#39;</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> write</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="n">advance</span><span class="o">=</span><span class="s1">&#39;no&#39;</span><span class="p">,</span><span class="n">fmt</span><span class="o">=</span><span class="s1">&#39;(a)&#39;</span><span class="p">)</span><span class="w"> </span><span class="s1">&#39; ; mode = real&#39;</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> write</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="n">advance</span><span class="o">=</span><span class="s1">&#39;no&#39;</span><span class="p">,</span><span class="n">fmt</span><span class="o">=</span><span class="s1">&#39;(a,i0)&#39;</span><span class="p">)</span><span class="w"> </span><span class="s1">&#39; ; stack size = &#39;</span><span class="p">,</span><span class="n">stack</span><span class="p">%</span><span class="n">get_size</span><span class="p">()</span><span class="w"></span>
<span class="w"> </span><span class="k">write</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="s1">&#39;(a/)&#39;</span><span class="p">)</span><span class="w"> </span><span class="s1">&#39;&#39;</span><span class="w"></span>
<span class="w"> </span><span class="k">case</span><span class="p">(</span><span class="s1">&#39;help&#39;</span><span class="p">,</span><span class="s1">&#39;h&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">call </span><span class="n">help</span><span class="w"></span>
<span class="w"> </span><span class="k">case </span><span class="n">default</span><span class="w"></span>
<span class="w"> </span><span class="c">! Process constants first</span>
<span class="w"> </span><span class="k">block</span>
<span class="k"> </span><span class="kt">integer</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">lc</span><span class="p">,</span><span class="w"> </span><span class="n">is_integer</span><span class="p">,</span><span class="n">split_idx</span><span class="p">,</span><span class="n">end_idx</span><span class="w"></span>
<span class="w"> </span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="p">:),</span><span class="w"> </span><span class="k">allocatable</span><span class="w"> </span><span class="kd">::</span><span class="w"> </span><span class="n">re_comp</span><span class="p">,</span><span class="w"> </span><span class="n">im_comp</span><span class="w"></span>
<span class="w"> </span><span class="n">lc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">len_trim</span><span class="p">(</span><span class="n">command</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">is_integer</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="nb">index</span><span class="p">(</span><span class="n">command</span><span class="p">,</span><span class="s1">&#39;.&#39;</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">complex_mode</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="mi">1</span><span class="p">:</span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s1">&#39;(&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">split_idx</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">index</span><span class="p">(</span><span class="n">command</span><span class="p">,</span><span class="s1">&#39;,&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">end_idx</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">index</span><span class="p">(</span><span class="n">command</span><span class="p">,</span><span class="s1">&#39;)&#39;</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">re_comp</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">command</span><span class="p">(</span><span class="mi">2</span><span class="p">:</span><span class="n">split_idx</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">im_comp</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">command</span><span class="p">(</span><span class="n">split_idx</span><span class="o">+</span><span class="mi">1</span><span class="p">:</span><span class="n">end_idx</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">constants</span><span class="p">%</span><span class="k">contains</span><span class="p">(</span><span class="n">re_comp</span><span class="p">))</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">z</span><span class="p">%</span><span class="n">re</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">constants</span><span class="p">%</span><span class="n">get_value</span><span class="p">(</span><span class="n">re_comp</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> read</span><span class="p">(</span><span class="n">re_comp</span><span class="p">,</span><span class="o">*</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">,</span><span class="k">end</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">z</span><span class="p">%</span><span class="n">re</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">constants</span><span class="p">%</span><span class="k">contains</span><span class="p">(</span><span class="n">im_comp</span><span class="p">))</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">z</span><span class="p">%</span><span class="n">im</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">constants</span><span class="p">%</span><span class="n">get_value</span><span class="p">(</span><span class="n">im_comp</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> read</span><span class="p">(</span><span class="n">im_comp</span><span class="p">,</span><span class="o">*</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">,</span><span class="k">end</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">z</span><span class="p">%</span><span class="n">im</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">command</span><span class="p">(</span><span class="n">lc</span><span class="p">:</span><span class="n">lc</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s1">&#39;p&#39;</span><span class="p">)</span><span class="w"> </span><span class="k">then</span>
<span class="k"> call </span><span class="n">stack</span><span class="p">%</span><span class="n">push</span><span class="p">(</span><span class="n">z</span><span class="p">,.</span><span class="n">false</span><span class="p">.)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> call </span><span class="n">stack</span><span class="p">%</span><span class="n">push</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> else</span>
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">constants</span><span class="p">%</span><span class="k">contains</span><span class="p">(</span><span class="n">command</span><span class="p">))</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">constants</span><span class="p">%</span><span class="n">get_value</span><span class="p">(</span><span class="n">command</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> read</span><span class="p">(</span><span class="n">command</span><span class="p">,</span><span class="o">*</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">,</span><span class="k">end</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">x</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> call </span><span class="n">stack</span><span class="p">%</span><span class="n">push</span><span class="p">(</span><span class="nb">cmplx</span><span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="mf">0.0d0</span><span class="p">,</span><span class="mi">8</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> </span>
<span class="k"> else</span>
<span class="k"> if</span><span class="w"> </span><span class="p">(</span><span class="n">constants</span><span class="p">%</span><span class="k">contains</span><span class="p">(</span><span class="n">command</span><span class="p">))</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">constants</span><span class="p">%</span><span class="n">get_value</span><span class="p">(</span><span class="n">command</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else if</span><span class="w"> </span><span class="p">(</span><span class="n">stats</span><span class="p">%</span><span class="k">contains</span><span class="p">(</span><span class="n">command</span><span class="p">))</span><span class="w"> </span><span class="k">then</span>
<span class="k"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stats</span><span class="p">%</span><span class="n">get_value</span><span class="p">(</span><span class="n">command</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span>
<span class="k"> read</span><span class="p">(</span><span class="n">command</span><span class="p">,</span><span class="o">*</span><span class="p">,</span><span class="n">err</span><span class="o">=</span><span class="mi">901</span><span class="p">,</span><span class="k">end</span><span class="o">=</span><span class="mi">901</span><span class="p">)</span><span class="w"> </span><span class="n">x</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> call </span><span class="n">stack</span><span class="p">%</span><span class="n">push</span><span class="p">(</span><span class="nb">cmplx</span><span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="mf">0.0d0</span><span class="p">,</span><span class="mi">8</span><span class="p">))</span><span class="w"></span>
<span class="w"> </span><span class="k">end if</span>
<span class="k"> end block</span>
<span class="k"> end select</span>
<span class="k"> return</span>
<span class="mi">901</span><span class="w"> </span><span class="k">continue</span>
<span class="k"> write</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="s1">&#39;(a)&#39;</span><span class="p">)</span><span class="w"> </span><span class="n">command</span><span class="o">//</span><span class="s1">&#39; ???&#39;</span><span class="w"></span>
<span class="w"> </span><span class="k">return</span>
<span class="k"> </span>
<span class="k"> end subroutine </span><span class="n">apply_command</span><span class="w"></span>
</pre></div>
</section>
<br>
</div>
</div>
<hr>
</div> <!-- /container -->
<footer>
<div class="container">
<div class="row">
<div class="col-xs-6 col-md-6"><p>hp was developed by sgeard<br>&copy; 2023
</p>
</div>
<div class="col-xs-6 col-md-6">
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
</p>
</div>
</div>
<br>
</div> <!-- /container -->
</footer>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!--
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
-->
<script src="../js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../js/ie10-viewport-bug-workaround.js"></script>
<!-- MathJax JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } },
jax: ['input/TeX','input/MathML','output/HTML-CSS'],
extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']
});
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="../tipuesearch/tipuesearch_content.js"></script>
<script src="../tipuesearch/tipuesearch_set.js"></script>
<script src="../tipuesearch/tipuesearch.js"></script>
</body>
</html>