<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>operand &#8211; Aptech</title>
	<atom:link href="https://www.aptech.com/blog/tag/operand/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.aptech.com</link>
	<description>GAUSS Software - Fastest Platform for Data Analytics</description>
	<lastBuildDate>Tue, 23 Apr 2024 20:22:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Understanding Errors: G0064 Operand Missing</title>
		<link>https://www.aptech.com/blog/understanding-errors-g0064-operand-missing/</link>
					<comments>https://www.aptech.com/blog/understanding-errors-g0064-operand-missing/#respond</comments>
		
		<dc:creator><![CDATA[aptech]]></dc:creator>
		<pubDate>Mon, 26 Jul 2021 14:26:38 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[operand]]></category>
		<guid isPermaLink="false">https://www.aptech.com/?p=11581524</guid>

					<description><![CDATA[Today we will help you to understand and resolve Error G0064: Operand Missing. We will answer the questions:

<ol>
<li>What is an operand?</li>
<li> How do common mathematical and non-mathematical operators interact with operands?</li>
<li>What are common causes of operand missing errors?</li>
</ol>]]></description>
										<content:encoded><![CDATA[<h3 id="introduction">Introduction</h3>
<p>Today we will help you to understand and resolve <code>Error G0064: Operand Missing</code>. We will answer the questions:</p>
<ul>
<li>What is an operand?</li>
<li>How do common mathematical and non-mathematical operators interact with operands?</li>
<li>What are common causes of operand missing errors?</li>
</ul>
<h2 id="what-is-an-operand">What is an operand?</h2>
<p>An operand is a symbol that an operator operates on. For example, in the line below:</p>
<pre class="hljs-container hljs-container-solo"><code class="lang-gauss">X = 4 + 5;</code></pre>
<p>The plus sign is the operator and both <code>4</code> and <code>5</code> are operands.</p>
<h2 id="mathematical-and-logical-operators">Mathematical and Logical Operators</h2>
<p>When you think of operators, the mathematical and logical operators tend to come to mind first. For example, operators like those shown in the table below.</p>
<table>
 <thead>
 <tr>
      <th style="background-color: #36434C" colspan="3"><span style="color:#FFFFFF">Mathematical and Logical Operators</span>
      </th>
   </tr>
<tr><th>Operator</th><th>Purpose</th>
</tr></thead>
<tbody>
<tr><td><code>+</code></td><td>Addition.</td></tr>
<tr><td><code>*</code>, <code>.*</code></td><td>Multiplication and element-by-element multiplication.</td></tr>
<tr><td><code>^</code></td><td>Exponentiation.</td></tr>
<tr><td><code>==</code>, <code>.==</code></td><td>Logical equality and element-by-element logical equality.</td></tr>
<tr><td><code>!==</code>, <code>.!==</code></td><td>Logical not equal and element-by-element logical not equal
</td></tr><tr><td><code>&gt;</code>, <code>.&gt;</code></td><td>Greater than and element-by-element greater.</td></tr>
</tbody>
</table>
<h3 id="operand-missing-errors-with-mathematical-and-logical-operators">Operand Missing Errors with Mathematical and Logical Operators</h3>
<p>Missing operand errors that occur with mathematical operators tend to be simple to understand and fix, so we will only show one example.</p>
<p><strong>Example 1</strong></p>
<table>
<thead>
<tr><th style="background-color: #E5F2E5"><span style="color:#008000">Correct statement</span></th><th style="background-color: #ffe5e5"><span style="color:#FF0000">Incorrect statement</span></th></tr>
</thead>
<tbody>
<tr><td><pre><code>// Multiply 6 by 5 
// and print  
// the result
6.*5;</code></pre></td><td><pre><code>// The left-hand 
// operand is 
// missing
.*5;</code></pre></td></tr>
<tr><td>The element-by-element multiplication operator requires two operands, one on the right-hand side and one on the left.</td><td>The code snippet is missing the left side operand and will return the operand missing error.</td></tr>
</tbody>
</table>
<h2 id="non-mathematical-operators">Non-mathematical Operators</h2>
<p>Unlike the logical and mathematical operators, many of the “other” operators are not commonly noticed or considered.</p>
<table>
 <thead>
 <tr>
      <th style="background-color: #36434C" colspan="3"><span style="color:#FFFFFF">Non-mathematical Operators</span>
      </th>
   </tr>
<tr><th>Operator</th><th>Description</th><th>Purpose</th>
</tr></thead>
<tbody>
<tr><td><code>,</code></td><td>Commma</td><td>Separates items in lists.</td></tr>
<tr><td><code> </code></td><td>Space</td><td>Separates items in print statements and indices inside index brackets.</td></tr>
<tr><td><code>.</code></td><td>Period</td><td>Signifies all rows or all columns inside of index brackets.</td></tr>
<tr><td><code>:</code></td><td>Colon</td><td>Creates a continuous series of indices inside of index brackets.</td></tr></tbody>
</table>
<h3 id="comma-operator-examples">Comma Operator Examples</h3>
<p><strong>Comma Operator Example One</strong></p>
<table>
<thead>
<tr><th style="background-color: #E5F2E5"><span style="color:#008000">Correct statement</span></th><th style="background-color: #ffe5e5"><span style="color:#FF0000">Incorrect statement</span></th></tr>
</thead>
<tbody>
<tr><td><pre><code>// Create a 4x2 matrix with 
// random normally 
// distributed numbers
X = rndn(4,2);</code></pre></td><td><pre><code>// No operands on either 
// side of the comma 
// operator
X = rndn(,);</code></pre></td></tr>
<tr><td>The comma operator is used to separate the operands 4 and 2.</td><td>The comma operator is used, but there are no operands for the comma operator to separate. </td></tr>
</tbody>
</table>
<p><strong>Comma Operator Example Two</strong></p>
<table>
<thead>
<tr><th style="background-color: #E5F2E5"><span style="color:#008000">Correct statement</span></th><th style="background-color: #ffe5e5"><span style="color:#FF0000">Incorrect statement</span></th></tr>
</thead>
<tbody>
<tr><td><pre><code>// Assign the element from  
// the 6th row and first 
// column to Z
Z = X[6,1];</code></pre></td><td><pre><code>// The operand to the right 
// of the comma operator 
// is missing
Z = X[6, ];</code></pre></td></tr>
<tr><td>The comma operator separates the index operands 6 and 1.</td><td>The comma operator is used, but there is not a column index on the right side of the comma.</td></tr>
</tbody>
</table>
<h3 id="colon-operator-example">Colon Operator Example</h3>
<p>Operand missing statements with the colon operator will look like the previous comma operator errors. </p>
<table>
<thead>
<tr><th style="background-color: #E5F2E5"><span style="color:#008000">Correct statement</span></th><th style="background-color: #ffe5e5"><span style="color:#FF0000">Incorrect statement</span></th></tr>
</thead>
<tbody>
<tr><td><pre><code>// Assign the 3rd to 5th 
// elements from the vector
// y to u
u = y[3:5];</code></pre></td><td><pre><code>// The operand to the
// right of the colon 
// operator is missing
u = y[3: ];</code></pre></td></tr>
<tr><td>The colon operator separates the index operands 3 and 5.</td><td>The colon operator is used, but there is not a column index on the right side of the colon.</td></tr>
</tbody>
</table>
<h2 id="print-statements-and-the-space-operator">Print Statements and the Space Operator</h2>
<p>The usage of space operator is probably the most likely “operand missing” error to trip up new GAUSS users.</p>
<p>The <a href="https://docs.aptech.com/gauss/print.html" target="_blank" rel="noopener"><code>print</code></a> statement takes a space-separated list of items to print. For example:</p>
<pre class="hljs-container hljs-container-solo"><code class="lang-gauss">print 4 5 6;</code></pre>
<p>will return:</p>
<pre>4.0000    5.0000    6.0000</pre>
<p>Similarly, we can print the same data with variables like this:</p>
<pre class="hljs-container hljs-container-solo"><code class="lang-gauss">A = 4;
B = 5;

print A B 6;</code></pre>
<p>And GAUSS will again return:</p>
<pre>4.0000    5.0000    6.0000</pre>
<p>So far this is quite simple and something you may have done without a thought. However, adding an operator can cause a problem. For example, because the <code>print</code> statement uses the space operator to separate the items to print, the statement:</p>
<pre class="hljs-container hljs-container-solo"><code class="lang-gauss">print A + B;</code></pre>
<p>is interpreted by GAUSS as the following instructions:</p>
<p>Print the value of A.<br />
Print the value of +.<br />
Print the value of B.    </p>
<p>Therefore, when GAUSS gets to the <code>+</code> sign, it does not see enough operands, because it has already been told to print A.</p>
<p>You can resolve this by removing the space operator between <code>A</code>, <code>+</code> and <code>B</code>, or by adding parentheses around the statement.</p>
<pre class="hljs-container hljs-container-solo"><code class="lang-gauss">A = 4;
B = 5;

// Option 1: Add parentheses 
// around the sum of A and B
print (A + B);

// Option 2: Remove space operator 
// to print the sum of A and B
print A+B;</code></pre>
<p>The parentheses (or dropped spaces) only need to be around the operator. The table below shows a few variations and the resulting printed output.</p>
<table>
 <thead>
<tr><th>Statement</th><th>Output</th></tr>
</thead>
<tbody>
<tr><td><pre><code>print (4 + 5) 6;</code></pre></td><td><code>9.0000    6.0000</code></td></tr>
<tr><td><pre><code>print (4 + 5)*6;</code></pre></td><td><code>54.0000</code></td></tr>
<tr><td><pre><code>print  ((4 + 5) / 6);</code></pre></td><td><code>1.5000</code></td></tr>
<tr><td><pre><code>print 4 5*6;</code></pre></td><td><code>4.0000 30.0000</code></td></tr>
</tbody></table>
<h3 id="conclusion">Conclusion</h3>
<p>Congratulations! In today's blog, you have learned:</p>
<ul>
<li>What mathematical, logical, and non-mathematical operands are in GAUSS. </li>
<li>Common causes of the <code>G0064: Operand Missing</code> error.</li>
</ul>
<h3 id="further-reading">Further reading</h3>
<ol>
<li><a href="https://www.aptech.com/blog/understanding-errors-g0025-undefined-symbol/" target="_blank" rel="noopener">Understanding Errors | G0025 : Undefined symbol</a></li>
<li><a href="https://www.aptech.com/blog/understanding-errors-g0058-index-out-of-range/" target="_blank" rel="noopener">Understanding Errors: G0058 Index out-of-Range</a></li>
<li><a href="https://www.aptech.com/blog/gauss-basics-6-logical-and-relational-operators/" target="_blank" rel="noopener">GAUSS Basics 6: Logical and relational operators</a></li>
</ol>
<p>    <!-- MathJax configuration -->
    <style>
        .mjx-svg-href {
            fill: "inherit" !important;
            stroke: "inherit" !important;
        }
    </style>
    <script type="text/x-mathjax-config">
        MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: "AMS"} } });
    </script>
    <script type="text/javascript">
window.MathJax = {
  tex2jax: {
    inlineMath: [ ['$','$'] ],
    displayMath: [ ['$$','$$'] ],
    processEscapes: true,
    processEnvironments: true
  },
  // Center justify equations in code and markdown cells. Elsewhere
  // we use CSS to left justify single line equations in code cells.
  displayAlign: 'center',
  "HTML-CSS": {
    styles: {'.MathJax_Display': {"margin": 0}},
    linebreaks: { automatic: false }
  },
  "SVG": {
    styles: {'.MathJax_SVG_Display': {"margin": 0}},
    linebreaks: { automatic: false }
  },
  showProcessingMessages: false,
  messageStyle: "none",
  menuSettings: { zoom: "Click" },
  AuthorInit: function() {
    MathJax.Hub.Register.StartupHook("End", function() {
            var timeout = false, // holder for timeout id
            delay = 250; // delay after event is "complete" to run callback
            var shrinkMath = function() {
              //var dispFormulas = document.getElementsByClassName("formula");
              var dispFormulas = document.getElementsByClassName("MathJax_SVG_Display");
              if (dispFormulas){
                // caculate relative size of indentation
                var contentTest = document.getElementsByTagName("body")[0];
                var nodesWidth = contentTest.offsetWidth;
                // if you have indentation
                var mathIndent = MathJax.Hub.config.displayIndent; //assuming px's
                var mathIndentValue = mathIndent.substring(0,mathIndent.length - 2);
                for (var i=0; i<dispFormulas.length; i++){
                  var dispFormula = dispFormulas[i];
                  var wrapper = dispFormula;
                  //var wrapper = dispFormula.getElementsByClassName("MathJax_Preview")[0].nextSibling;
                  var child = wrapper.firstChild;
                  wrapper.style.transformOrigin = "center"; //or top-left if you left-align your equations
                  var oldScale = child.style.transform;
                  //var newValue = Math.min(0.80*dispFormula.offsetWidth / child.offsetWidth,1.0).toFixed(2);
                  var newValue = Math.min(dispFormula.offsetWidth / child.offsetWidth,1.0).toFixed(2);
                  var newScale = "scale(" + newValue + ")";
                  if(newValue != "NaN" && !(newScale === oldScale)){
                    wrapper.style.transform = newScale;
                    wrapper.style["margin-left"]= Math.pow(newValue,4)*mathIndentValue + "px";
                    var wrapperStyle = window.getComputedStyle(wrapper);
                    var wrapperHeight = parseFloat(wrapperStyle.height);
                    wrapper.style.height = "" + (wrapperHeight * newValue) + "px";
                    if(newValue === "1.00"){
                      wrapper.style.cursor = "";
                      wrapper.style.height = "";
                    }
                    else {
                      wrapper.style.cursor = "zoom-in";
                    }
                  }

                }
            }
            };
            shrinkMath();
            window.addEventListener('resize', function() {
              clearTimeout(timeout);
              timeout = setTimeout(shrinkMath, delay);
            });
          });
  }
}
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS_SVG"></script></p>]]></content:encoded>
					
					<wfw:commentRss>https://www.aptech.com/blog/understanding-errors-g0064-operand-missing/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
