Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > b3bdfe6d859a3d6920ff2c44b38e9a6f > files > 224

saxon-manual-9.4.0.9-2.mga7.noarch.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="expressions" page="arithmetic" subpage="unary"/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: Unary plus and minus</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title"
            content="Saxonica: XSLT and XQuery Processing: Unary plus and minus"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>Unary plus and minus</h1>
      <p>The unary minus operator changes the sign of a number. For example <code>-1</code> is minus one, and
<code>-0e0</code> is the double value negative zero.</p>
      <p>Unary plus has very little effect: the value of <code>+1</code> is the same as the value of <code>1</code>.
It does, however, provide a quick way of forcing untyped values to be numeric, for example you can write
<code>&lt;xsl:sort select="+@price"/&gt;</code> to force a numeric sort, if you find 
<code>&lt;xsl:sort select="number(@price)"/&gt;</code> too verbose for your tastes.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="multiplication.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>