⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 language.operators.arithmetic.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Arithmetic Operators</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="language.operators.html">Operators</a></div> <div class="next" style="text-align: right; float: right;"><a href="language.operators.assignment.html">Assignment Operators</a></div> <div class="up"><a href="language.operators.html">Operators</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="language.operators.arithmetic" class="sect1">   <h2 class="title">Arithmetic Operators</h2>   <p class="simpara">    Remember basic arithmetic from school? These work just    like those.   </p>   <table border="5">    <caption><b>Arithmetic Operators</b></caption>    <colgroup>     <thead valign="middle">      <tr valign="middle">       <th colspan="1">Example</th>       <th colspan="1">Name</th>       <th colspan="1">Result</th>      </tr>     </thead>     <tbody valign="middle" class="tbody">      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">-$a</td>       <td colspan="1" rowspan="1" align="left">Negation</td>       <td colspan="1" rowspan="1" align="left">Opposite of $a.</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">$a + $b</td>       <td colspan="1" rowspan="1" align="left">Addition</td>       <td colspan="1" rowspan="1" align="left">Sum of $a and $b.</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">$a - $b</td>       <td colspan="1" rowspan="1" align="left">Subtraction</td>       <td colspan="1" rowspan="1" align="left">Difference of $a and $b.</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">$a * $b</td>       <td colspan="1" rowspan="1" align="left">Multiplication</td>       <td colspan="1" rowspan="1" align="left">Product of $a and $b.</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">$a / $b</td>       <td colspan="1" rowspan="1" align="left">Division</td>       <td colspan="1" rowspan="1" align="left">Quotient of $a and $b.</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">$a % $b</td>       <td colspan="1" rowspan="1" align="left">Modulus</td>       <td colspan="1" rowspan="1" align="left">Remainder of $a divided by $b.</td>      </tr>     </tbody>    </colgroup>   </table>   <p class="simpara">    The division operator (&quot;/&quot;) returns a float value unless the two operands    are integers (or strings that get converted to integers) and the numbers    are evenly divisible, in which case an integer value will be returned.   </p>   <p class="simpara">    Operands of modulus are converted to integers (by stripping the decimal    part) before processing.   </p>   <blockquote><p><b class="note">Note</b>:     <span class="simpara">     Remainder <i>$a % $b</i> is negative for negative     <i>$a</i>.    </span>   </p></blockquote>   <p class="simpara">    See also the manual page on     <a href="ref.math.html" class="link">Math functions</a>.    </p>  </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="language.operators.html">Operators</a></div> <div class="next" style="text-align: right; float: right;"><a href="language.operators.assignment.html">Assignment Operators</a></div> <div class="up"><a href="language.operators.html">Operators</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -