<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>NVIDIA CUDA Library: Mathematical Functions</title> <link href="customdoxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.8 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> </div> <div class="contents"> <h1>Mathematical Functions</h1><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Modules</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__CUDA__MATH__SINGLE.html">Single Precision Mathematical Functions</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__CUDA__MATH__DOUBLE.html">Double Precision Mathematical Functions</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__CUDA__MATH__INTRINSIC__SINGLE.html">Single Precision Intrinsics</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__CUDA__MATH__INTRINSIC__DOUBLE.html">Double Precision Intrinsics</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__CUDA__MATH__INTRINSIC__INT.html">Integer Intrinsics</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__CUDA__MATH__INTRINSIC__CAST.html">Type Casting Intrinsics</a></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> CUDA mathematical functions are always available in device code. Some functions are also available in host code as indicated.<p> Note that floating-point functions are overloaded for different argument types. For example, the <a class="el" href="group__CUDA__MATH__DOUBLE_g28ce8e15ef5149c271eba95663becba2.html#g28ce8e15ef5149c271eba95663becba2" title="Calculate the base logarithm of the input argument.">log()</a> function has the following prototypes: <div class="fragment"><pre class="fragment"> <span class="keywordtype">double</span> <a class="code" href="group__CUDA__MATH__DOUBLE_g28ce8e15ef5149c271eba95663becba2.html#g28ce8e15ef5149c271eba95663becba2" title="Calculate the base logarithm of the input argument.">log</a>(<span class="keywordtype">double</span> x); <span class="keywordtype">float</span> <a class="code" href="group__CUDA__MATH__DOUBLE_g28ce8e15ef5149c271eba95663becba2.html#g28ce8e15ef5149c271eba95663becba2" title="Calculate the base logarithm of the input argument.">log</a>(<span class="keywordtype">float</span> x); <span class="keywordtype">float</span> <a class="code" href="group__CUDA__MATH__SINGLE_gcdaf041c4071f63cba0e51658b89ffa4.html#gcdaf041c4071f63cba0e51658b89ffa4" title="Calculate the natural logarithm of the input argument.">logf</a>(<span class="keywordtype">float</span> x); </pre></div> </div> <hr size="1"><address style="text-align: right;"><small> Generated by Doxygen for NVIDIA CUDA Library <a href="http://www.nvidia.com/cuda"><img src="nvidia_logo.jpg" alt="NVIDIA" align="middle" border="0" height="80"></a></small></address> </body> </html>