Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 834

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qmath.qdoc -->
  <title>&lt;QtMath&gt; - Generic Math Functions | Qt Core 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtcore-index.html">Qt Core</a></td><td >&lt;QtMath&gt; - Generic Math Functions</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">&lt;QtMath&gt; - Generic Math Functions</h1>
<span class="subtitle"></span>
<!-- $$$<QtMath>-brief -->
<p>The &lt;QtMath&gt; header file provides various math functions. <a href="#details">More...</a></p>
<!-- @@@<QtMath> -->
<ul>
</ul>
<a name="Functions"></a>
<h2 id="Functions">Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qAcos">qAcos</a></b>(qreal <i>v</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qAsin">qAsin</a></b>(qreal <i>v</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qAtan2">qAtan2</a></b>(qreal <i>y</i>, qreal <i>x</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qAtan">qAtan</a></b>(qreal <i>v</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qCeil">qCeil</a></b>(qreal <i>v</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qCos">qCos</a></b>(qreal <i>v</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> float </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qDegreesToRadians">qDegreesToRadians</a></b>(float <i>degrees</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> double </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qDegreesToRadians-1">qDegreesToRadians</a></b>(double <i>degrees</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qExp">qExp</a></b>(qreal <i>v</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qFabs">qFabs</a></b>(qreal <i>v</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qFloor">qFloor</a></b>(qreal <i>v</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qLn">qLn</a></b>(qreal <i>v</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> quint32 </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qNextPowerOfTwo">qNextPowerOfTwo</a></b>(quint32 <i>value</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> quint32 </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qNextPowerOfTwo-1">qNextPowerOfTwo</a></b>(qint32 <i>value</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> quint64 </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qNextPowerOfTwo-2">qNextPowerOfTwo</a></b>(quint64 <i>value</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> quint64 </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qNextPowerOfTwo-3">qNextPowerOfTwo</a></b>(qint64 <i>value</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qPow">qPow</a></b>(qreal <i>x</i>, qreal <i>y</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> float </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qRadiansToDegrees">qRadiansToDegrees</a></b>(float <i>radians</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> double </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qRadiansToDegrees-1">qRadiansToDegrees</a></b>(double <i>radians</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qSin">qSin</a></b>(qreal <i>v</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qSqrt">qSqrt</a></b>(qreal <i>v</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtmath.html#qTan">qTan</a></b>(qreal <i>v</i>)</td></tr>
</table></div>
<!-- $$$<QtMath>-description -->
<div class="descr"> <a name="details"></a>
<p>These functions are partly convenience definitions for basic math operations not available in the C or Standard Template Libraries.</p>
</div>
<!-- @@@<QtMath> -->
<h2>Function Documentation</h2>
<!-- $$$qAcos[overload1]$$$qAcosqreal -->
<h3 class="fn" id="qAcos"><a name="qAcos"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <span class="name">qAcos</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>)</h3>
<p>Returns the arccosine of <i>v</i> as an angle in radians. Arccosine is the inverse operation of cosine.</p>
<p><b>See also </b><a href="qtmath.html#qAtan">qAtan</a>(), <a href="qtmath.html#qAsin">qAsin</a>(), and <a href="qtmath.html#qCos">qCos</a>().</p>
<!-- @@@qAcos -->
<!-- $$$qAsin[overload1]$$$qAsinqreal -->
<h3 class="fn" id="qAsin"><a name="qAsin"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <span class="name">qAsin</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>)</h3>
<p>Returns the arcsine of <i>v</i> as an angle in radians. Arcsine is the inverse operation of sine.</p>
<p><b>See also </b><a href="qtmath.html#qSin">qSin</a>(), <a href="qtmath.html#qAtan">qAtan</a>(), and <a href="qtmath.html#qAcos">qAcos</a>().</p>
<!-- @@@qAsin -->
<!-- $$$qAtan2[overload1]$$$qAtan2qrealqreal -->
<h3 class="fn" id="qAtan2"><a name="qAtan2"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <span class="name">qAtan2</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>)</h3>
<p>Returns the arctangent of a point specified by the coordinates <i>y</i> and <i>x</i>. This function will return the angle (argument) of that point.</p>
<p><b>See also </b><a href="qtmath.html#qAtan">qAtan</a>().</p>
<!-- @@@qAtan2 -->
<!-- $$$qAtan[overload1]$$$qAtanqreal -->
<h3 class="fn" id="qAtan"><a name="qAtan"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <span class="name">qAtan</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>)</h3>
<p>Returns the arctangent of <i>v</i> as an angle in radians. Arctangent is the inverse operation of tangent.</p>
<p><b>See also </b><a href="qtmath.html#qTan">qTan</a>(), <a href="qtmath.html#qAcos">qAcos</a>(), and <a href="qtmath.html#qAsin">qAsin</a>().</p>
<!-- @@@qAtan -->
<!-- $$$qCeil[overload1]$$$qCeilqreal -->
<h3 class="fn" id="qCeil"><a name="qCeil"></a><span class="type">int</span> <span class="name">qCeil</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>)</h3>
<p>Return the ceiling of the value <i>v</i>.</p>
<p>The ceiling is the smallest integer that is not less than <i>v</i>. For example, if <i>v</i> is 41.2, then the ceiling is 42.</p>
<p><b>See also </b><a href="qtmath.html#qFloor">qFloor</a>().</p>
<!-- @@@qCeil -->
<!-- $$$qCos[overload1]$$$qCosqreal -->
<h3 class="fn" id="qCos"><a name="qCos"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <span class="name">qCos</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>)</h3>
<p>Returns the cosine of an angle <i>v</i> in radians.</p>
<p><b>See also </b><a href="qtmath.html#qSin">qSin</a>() and <a href="qtmath.html#qTan">qTan</a>().</p>
<!-- @@@qCos -->
<!-- $$$qDegreesToRadians[overload1]$$$qDegreesToRadiansfloat -->
<h3 class="fn" id="qDegreesToRadians"><a name="qDegreesToRadians"></a><span class="type">float</span> <span class="name">qDegreesToRadians</span>(<span class="type">float</span> <i>degrees</i>)</h3>
<p>This function converts the <i>degrees</i> in float to radians.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type">float</span> degrees <span class="operator">=</span> <span class="number">180.0f</span>
  <span class="type">float</span> radians <span class="operator">=</span> qDegreesToRadians(degrees)

</pre>
<p>This function was introduced in  Qt 5.1.</p>
<p><b>See also </b><a href="qtmath.html#qRadiansToDegrees">qRadiansToDegrees</a>().</p>
<!-- @@@qDegreesToRadians -->
<!-- $$$qDegreesToRadians$$$qDegreesToRadiansdouble -->
<h3 class="fn" id="qDegreesToRadians-1"><a name="qDegreesToRadians-1"></a><span class="type">double</span> <span class="name">qDegreesToRadians</span>(<span class="type">double</span> <i>degrees</i>)</h3>
<p>This function converts the <i>degrees</i> in double to radians.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type">double</span> degrees <span class="operator">=</span> <span class="number">180.0</span>
  <span class="type">double</span> radians <span class="operator">=</span> <a href="qtmath.html#qDegreesToRadians">qDegreesToRadians</a>(degrees)

</pre>
<p>This function was introduced in  Qt 5.1.</p>
<p><b>See also </b><a href="qtmath.html#qRadiansToDegrees">qRadiansToDegrees</a>().</p>
<!-- @@@qDegreesToRadians -->
<!-- $$$qExp[overload1]$$$qExpqreal -->
<h3 class="fn" id="qExp"><a name="qExp"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <span class="name">qExp</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>)</h3>
<p>Returns the exponential function of <code>e</code> to the power of <i>v</i>.</p>
<p><b>See also </b><a href="qtmath.html#qLn">qLn</a>().</p>
<!-- @@@qExp -->
<!-- $$$qFabs[overload1]$$$qFabsqreal -->
<h3 class="fn" id="qFabs"><a name="qFabs"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <span class="name">qFabs</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>)</h3>
<p>Returns the absolute value of <i>v</i> as a qreal.</p>
<!-- @@@qFabs -->
<!-- $$$qFloor[overload1]$$$qFloorqreal -->
<h3 class="fn" id="qFloor"><a name="qFloor"></a><span class="type">int</span> <span class="name">qFloor</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>)</h3>
<p>Return the floor of the value <i>v</i>.</p>
<p>The floor is the largest integer that is not greater than <i>v</i>. For example, if <i>v</i> is 41.2, then the floor is 41.</p>
<p><b>See also </b><a href="qtmath.html#qCeil">qCeil</a>().</p>
<!-- @@@qFloor -->
<!-- $$$qLn[overload1]$$$qLnqreal -->
<h3 class="fn" id="qLn"><a name="qLn"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <span class="name">qLn</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>)</h3>
<p>Returns the natural logarithm of <i>v</i>. Natural logarithm uses base e.</p>
<p><b>See also </b><a href="qtmath.html#qExp">qExp</a>().</p>
<!-- @@@qLn -->
<!-- $$$qNextPowerOfTwo[overload1]$$$qNextPowerOfTwoquint32 -->
<h3 class="fn" id="qNextPowerOfTwo"><a name="qNextPowerOfTwo"></a><span class="type"><a href="qtglobal.html#quint32-typedef">quint32</a></span> <span class="name">qNextPowerOfTwo</span>(<span class="type"><a href="qtglobal.html#quint32-typedef">quint32</a></span> <i>value</i>)</h3>
<p>This function returns the nearest power of two greater than <i>value</i>. For 0 it returns 1, and for values larger than or equal to 2^31 it returns 0.</p>
<p>This function was introduced in  Qt 5.4.</p>
<!-- @@@qNextPowerOfTwo -->
<!-- $$$qNextPowerOfTwo$$$qNextPowerOfTwoqint32 -->
<h3 class="fn" id="qNextPowerOfTwo-1"><a name="qNextPowerOfTwo-1"></a><span class="type"><a href="qtglobal.html#quint32-typedef">quint32</a></span> <span class="name">qNextPowerOfTwo</span>(<span class="type"><a href="qtglobal.html#qint32-typedef">qint32</a></span> <i>value</i>)</h3>
<p>This is an overloaded function.</p>
<p>This function returns the nearest power of two greater than <i>value</i>. For negative values it returns 0.</p>
<p>This function was introduced in  Qt 5.4.</p>
<!-- @@@qNextPowerOfTwo -->
<!-- $$$qNextPowerOfTwo$$$qNextPowerOfTwoquint64 -->
<h3 class="fn" id="qNextPowerOfTwo-2"><a name="qNextPowerOfTwo-2"></a><span class="type"><a href="qtglobal.html#quint64-typedef">quint64</a></span> <span class="name">qNextPowerOfTwo</span>(<span class="type"><a href="qtglobal.html#quint64-typedef">quint64</a></span> <i>value</i>)</h3>
<p>This function returns the nearest power of two greater than <i>value</i>. For 0 it returns 1, and for values larger than or equal to 2^63 it returns 0.</p>
<p>This function was introduced in  Qt 5.4.</p>
<!-- @@@qNextPowerOfTwo -->
<!-- $$$qNextPowerOfTwo$$$qNextPowerOfTwoqint64 -->
<h3 class="fn" id="qNextPowerOfTwo-3"><a name="qNextPowerOfTwo-3"></a><span class="type"><a href="qtglobal.html#quint64-typedef">quint64</a></span> <span class="name">qNextPowerOfTwo</span>(<span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> <i>value</i>)</h3>
<p>This is an overloaded function.</p>
<p>This function returns the nearest power of two greater than <i>value</i>. For negative values it returns 0.</p>
<p>This function was introduced in  Qt 5.4.</p>
<!-- @@@qNextPowerOfTwo -->
<!-- $$$qPow[overload1]$$$qPowqrealqreal -->
<h3 class="fn" id="qPow"><a name="qPow"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <span class="name">qPow</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>)</h3>
<p>Returns the value of <i>x</i> raised to the power of <i>y</i>. That is, <i>x</i> is the base and <i>y</i> is the exponent.</p>
<p><b>See also </b><a href="qtmath.html#qSqrt">qSqrt</a>().</p>
<!-- @@@qPow -->
<!-- $$$qRadiansToDegrees[overload1]$$$qRadiansToDegreesfloat -->
<h3 class="fn" id="qRadiansToDegrees"><a name="qRadiansToDegrees"></a><span class="type">float</span> <span class="name">qRadiansToDegrees</span>(<span class="type">float</span> <i>radians</i>)</h3>
<p>This function converts the <i>radians</i> in float to degrees.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type">float</span> radians <span class="operator">=</span> <span class="type">float</span>(M_PI)
  <span class="type">float</span> degrees <span class="operator">=</span> qRadiansToDegrees(radians)

</pre>
<p>This function was introduced in  Qt 5.1.</p>
<p><b>See also </b><a href="qtmath.html#qDegreesToRadians">qDegreesToRadians</a>().</p>
<!-- @@@qRadiansToDegrees -->
<!-- $$$qRadiansToDegrees$$$qRadiansToDegreesdouble -->
<h3 class="fn" id="qRadiansToDegrees-1"><a name="qRadiansToDegrees-1"></a><span class="type">double</span> <span class="name">qRadiansToDegrees</span>(<span class="type">double</span> <i>radians</i>)</h3>
<p>This function converts the <i>radians</i> in double to degrees.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type">double</span> radians <span class="operator">=</span> M_PI
  <span class="type">double</span> degrees <span class="operator">=</span> <a href="qtmath.html#qRadiansToDegrees">qRadiansToDegrees</a>(radians)

</pre>
<p>This function was introduced in  Qt 5.1.</p>
<p><b>See also </b><a href="qtmath.html#qDegreesToRadians">qDegreesToRadians</a>().</p>
<!-- @@@qRadiansToDegrees -->
<!-- $$$qSin[overload1]$$$qSinqreal -->
<h3 class="fn" id="qSin"><a name="qSin"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <span class="name">qSin</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>)</h3>
<p>Returns the sine of the angle <i>v</i> in radians.</p>
<p><b>See also </b><a href="qtmath.html#qCos">qCos</a>() and <a href="qtmath.html#qTan">qTan</a>().</p>
<!-- @@@qSin -->
<!-- $$$qSqrt[overload1]$$$qSqrtqreal -->
<h3 class="fn" id="qSqrt"><a name="qSqrt"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <span class="name">qSqrt</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>)</h3>
<p>Returns the square root of <i>v</i>. This function returns a NaN if <i>v</i> is a negative number.</p>
<p><b>See also </b><a href="qtmath.html#qPow">qPow</a>().</p>
<!-- @@@qSqrt -->
<!-- $$$qTan[overload1]$$$qTanqreal -->
<h3 class="fn" id="qTan"><a name="qTan"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <span class="name">qTan</span>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>v</i>)</h3>
<p>Returns the tangent of an angle <i>v</i> in radians.</p>
<p><b>See also </b><a href="qtmath.html#qSin">qSin</a>() and <a href="qtmath.html#qCos">qCos</a>().</p>
<!-- @@@qTan -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>