Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > b38d2da330d1936e5ab1307c039c4941 > files > 45

octave-doc-3.6.4-3.mga4.noarch.rpm

<html lang="en">
<head>
<title>Exclamation mark as not operator - Frequently asked questions about Octave (with answers)</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Frequently asked questions about Octave (with answers)">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Octave-Features.html#Octave-Features" title="Octave Features">
<link rel="prev" href="Coherent-syntax.html#Coherent-syntax" title="Coherent syntax">
<link rel="next" href="Increment-and-decrement-operators.html#Increment-and-decrement-operators" title="Increment and decrement operators">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Exclamation-mark-as-not-operator"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Increment-and-decrement-operators.html#Increment-and-decrement-operators">Increment and decrement operators</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Coherent-syntax.html#Coherent-syntax">Coherent syntax</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Octave-Features.html#Octave-Features">Octave Features</a>
<hr>
</div>

<h3 class="section">5.7 Exclamation mark as not operator</h3>

<p>The exclamation mark &lsquo;<samp><span class="samp">!</span></samp>&rsquo; (aka &ldquo;Bang!&rdquo;) is a negation operator, just
like the tilde &lsquo;<samp><span class="samp">~</span></samp>&rsquo;:

<pre class="example">     octave:1&gt; if ! strcmp (program_name, "octave"),
     &gt;   "It's an error"
     &gt; else
     &gt;   "It works!"
     &gt; end
     ans = It works!
</pre>
   <p class="noindent">Note however that <span class="sc">Matlab</span> uses the &lsquo;<samp><span class="samp">!</span></samp>&rsquo; operator for shell
escapes, for which Octave requires using the <code>system</code> command.

   </body></html>