You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
572 lines
59 KiB
HTML
572 lines
59 KiB
HTML
<!-- HTML header for doxygen 1.8.7-->
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.6.3"/>
|
|
<!--BEGIN PROJECT_NAME--><title>avr-libc: avr-libc: math.h Source File</title><!--END PROJECT_NAME-->
|
|
<!--BEGIN !PROJECT_NAME--><title>avr-libc: math.h Source File</title><!--END !PROJECT_NAME-->
|
|
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
|
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
|
$treeview
|
|
$search
|
|
$mathjax
|
|
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
|
$extrastylesheet
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
|
|
<!--BEGIN TITLEAREA-->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<!--BEGIN PROJECT_LOGO-->
|
|
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
|
|
<!--END PROJECT_LOGO-->
|
|
<!--BEGIN PROJECT_NAME-->
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">avr-libc
|
|
<!--BEGIN PROJECT_NUMBER--> <span id="projectnumber">2.0.0</span><!--END PROJECT_NUMBER-->
|
|
</div>
|
|
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
|
|
</td>
|
|
<!--END PROJECT_NAME-->
|
|
<!--BEGIN !PROJECT_NAME-->
|
|
<!--BEGIN PROJECT_BRIEF-->
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectbrief">$projectbrief</div>
|
|
</td>
|
|
<!--END PROJECT_BRIEF-->
|
|
<!--END !PROJECT_NAME-->
|
|
<!--BEGIN DISABLE_INDEX-->
|
|
<!--BEGIN SEARCHENGINE-->
|
|
<td>$searchbox</td>
|
|
<!--END SEARCHENGINE-->
|
|
<!--END DISABLE_INDEX-->
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table>
|
|
<tr>
|
|
<td align="left"><a href="http://www.nongnu.org/avr-libc/"><h2>AVR Libc Home Page</h2></a></td>
|
|
<td align="center" colspan=4><img src="avrs.png" alt="AVRs" align="middle" border="0"></td>
|
|
<td align="right"><a href="https://savannah.nongnu.org/projects/avr-libc/"><h2>AVR Libc Development Pages</h2></a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="20%"><a href="index.html"><h2>Main Page</h2></a></td>
|
|
<td align="center" width="20%"><a href="pages.html"><h2>User Manual</h2></a></td>
|
|
<td align="center" width="20%"><a href="modules.html"><h2>Library Reference</h2></a></td>
|
|
<td align="center" width="20%"><a href="FAQ.html"><h2>FAQ</h2></a></td>
|
|
<td align="center" width="20%"><a href="group__demos.html"><h2>Example Projects</h2></a></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<!--END TITLEAREA-->
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.6.3 -->
|
|
<script type="text/javascript"><!--
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
--></script>
|
|
<h1>math.h</h1><a href="math_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* Copyright (c) 2002,2007-2009 Michael Stumpf</span>
|
|
<a name="l00002"></a>00002 <span class="comment"></span>
|
|
<a name="l00003"></a>00003 <span class="comment"> Portions of documentation Copyright (c) 1990 - 1994</span>
|
|
<a name="l00004"></a>00004 <span class="comment"> The Regents of the University of California.</span>
|
|
<a name="l00005"></a>00005 <span class="comment"></span>
|
|
<a name="l00006"></a>00006 <span class="comment"> All rights reserved.</span>
|
|
<a name="l00007"></a>00007 <span class="comment"></span>
|
|
<a name="l00008"></a>00008 <span class="comment"> Redistribution and use in source and binary forms, with or without</span>
|
|
<a name="l00009"></a>00009 <span class="comment"> modification, are permitted provided that the following conditions are met:</span>
|
|
<a name="l00010"></a>00010 <span class="comment"></span>
|
|
<a name="l00011"></a>00011 <span class="comment"> * Redistributions of source code must retain the above copyright</span>
|
|
<a name="l00012"></a>00012 <span class="comment"> notice, this list of conditions and the following disclaimer.</span>
|
|
<a name="l00013"></a>00013 <span class="comment"></span>
|
|
<a name="l00014"></a>00014 <span class="comment"> * Redistributions in binary form must reproduce the above copyright</span>
|
|
<a name="l00015"></a>00015 <span class="comment"> notice, this list of conditions and the following disclaimer in</span>
|
|
<a name="l00016"></a>00016 <span class="comment"> the documentation and/or other materials provided with the</span>
|
|
<a name="l00017"></a>00017 <span class="comment"> distribution.</span>
|
|
<a name="l00018"></a>00018 <span class="comment"></span>
|
|
<a name="l00019"></a>00019 <span class="comment"> * Neither the name of the copyright holders nor the names of</span>
|
|
<a name="l00020"></a>00020 <span class="comment"> contributors may be used to endorse or promote products derived</span>
|
|
<a name="l00021"></a>00021 <span class="comment"> from this software without specific prior written permission.</span>
|
|
<a name="l00022"></a>00022 <span class="comment"></span>
|
|
<a name="l00023"></a>00023 <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span>
|
|
<a name="l00024"></a>00024 <span class="comment"> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
|
|
<a name="l00025"></a>00025 <span class="comment"> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
|
|
<a name="l00026"></a>00026 <span class="comment"> ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE</span>
|
|
<a name="l00027"></a>00027 <span class="comment"> LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span>
|
|
<a name="l00028"></a>00028 <span class="comment"> CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span>
|
|
<a name="l00029"></a>00029 <span class="comment"> SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span>
|
|
<a name="l00030"></a>00030 <span class="comment"> INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span>
|
|
<a name="l00031"></a>00031 <span class="comment"> CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span>
|
|
<a name="l00032"></a>00032 <span class="comment"> ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span>
|
|
<a name="l00033"></a>00033 <span class="comment"> POSSIBILITY OF SUCH DAMAGE. */</span>
|
|
<a name="l00034"></a>00034
|
|
<a name="l00035"></a>00035 <span class="comment">/* $Id$ */</span>
|
|
<a name="l00036"></a>00036
|
|
<a name="l00037"></a>00037 <span class="comment">/*</span>
|
|
<a name="l00038"></a>00038 <span class="comment"> math.h - mathematical functions</span>
|
|
<a name="l00039"></a>00039 <span class="comment"></span>
|
|
<a name="l00040"></a>00040 <span class="comment"> Author : Michael Stumpf</span>
|
|
<a name="l00041"></a>00041 <span class="comment"> Michael.Stumpf@t-online.de</span>
|
|
<a name="l00042"></a>00042 <span class="comment"></span>
|
|
<a name="l00043"></a>00043 <span class="comment"> __ATTR_CONST__ added by marekm@linux.org.pl for functions</span>
|
|
<a name="l00044"></a>00044 <span class="comment"> that "do not examine any values except their arguments, and have</span>
|
|
<a name="l00045"></a>00045 <span class="comment"> no effects except the return value", for better optimization by gcc.</span>
|
|
<a name="l00046"></a>00046 <span class="comment"> */</span>
|
|
<a name="l00047"></a>00047
|
|
<a name="l00048"></a>00048 <span class="preprocessor">#ifndef __MATH_H</span>
|
|
<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#define __MATH_H</span>
|
|
<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00051"></a>00051 <span class="comment">/** \file */</span><span class="comment"></span>
|
|
<a name="l00052"></a>00052 <span class="comment">/** \defgroup avr_math <math.h>: Mathematics</span>
|
|
<a name="l00053"></a>00053 <span class="comment"> \code #include <math.h> \endcode</span>
|
|
<a name="l00054"></a>00054 <span class="comment"></span>
|
|
<a name="l00055"></a>00055 <span class="comment"> This header file declares basic mathematics constants and</span>
|
|
<a name="l00056"></a>00056 <span class="comment"> functions.</span>
|
|
<a name="l00057"></a>00057 <span class="comment"></span>
|
|
<a name="l00058"></a>00058 <span class="comment"> \par Notes:</span>
|
|
<a name="l00059"></a>00059 <span class="comment"> - In order to access the functions declared herein, it is usually</span>
|
|
<a name="l00060"></a>00060 <span class="comment"> also required to additionally link against the library \c libm.a.</span>
|
|
<a name="l00061"></a>00061 <span class="comment"> See also the related \ref faq_libm "FAQ entry".</span>
|
|
<a name="l00062"></a>00062 <span class="comment"> - Math functions do not raise exceptions and do not change the</span>
|
|
<a name="l00063"></a>00063 <span class="comment"> \c errno variable. Therefore the majority of them are declared</span>
|
|
<a name="l00064"></a>00064 <span class="comment"> with const attribute, for better optimization by GCC. */</span>
|
|
<a name="l00065"></a>00065
|
|
<a name="l00066"></a>00066 <span class="comment"></span>
|
|
<a name="l00067"></a>00067 <span class="comment">/** \ingroup avr_math */</span><span class="comment"></span>
|
|
<a name="l00068"></a>00068 <span class="comment">/*@{*/</span>
|
|
<a name="l00069"></a>00069 <span class="comment"></span>
|
|
<a name="l00070"></a>00070 <span class="comment">/** The constant \a e. */</span>
|
|
<a name="l00071"></a><a class="code" href="group__avr__math.html#ga9bf5d952c5c93c70f9e66c9794d406c9">00071</a> <span class="preprocessor">#define M_E 2.7182818284590452354</span>
|
|
<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00073"></a>00073 <span class="comment">/** The logarithm of the \a e to base 2. */</span>
|
|
<a name="l00074"></a><a class="code" href="group__avr__math.html#gac5c747ee5bcbe892875672a0b9d8171c">00074</a> <span class="preprocessor">#define M_LOG2E 1.4426950408889634074 </span><span class="comment">/* log_2 e */</span>
|
|
<a name="l00075"></a>00075 <span class="comment"></span>
|
|
<a name="l00076"></a>00076 <span class="comment">/** The logarithm of the \a e to base 10. */</span>
|
|
<a name="l00077"></a><a class="code" href="group__avr__math.html#ga9ed2b5582226f3896424ff6d2a3ebb14">00077</a> <span class="preprocessor">#define M_LOG10E 0.43429448190325182765 </span><span class="comment">/* log_10 e */</span>
|
|
<a name="l00078"></a>00078 <span class="comment"></span>
|
|
<a name="l00079"></a>00079 <span class="comment">/** The natural logarithm of the 2. */</span>
|
|
<a name="l00080"></a><a class="code" href="group__avr__math.html#ga92428112a5d24721208748774a4f23e6">00080</a> <span class="preprocessor">#define M_LN2 0.69314718055994530942 </span><span class="comment">/* log_e 2 */</span>
|
|
<a name="l00081"></a>00081 <span class="comment"></span>
|
|
<a name="l00082"></a>00082 <span class="comment">/** The natural logarithm of the 10. */</span>
|
|
<a name="l00083"></a><a class="code" href="group__avr__math.html#ga0a53871497a155afe91424c28a8ec3c4">00083</a> <span class="preprocessor">#define M_LN10 2.30258509299404568402 </span><span class="comment">/* log_e 10 */</span>
|
|
<a name="l00084"></a>00084 <span class="comment"></span>
|
|
<a name="l00085"></a>00085 <span class="comment">/** The constant \a pi. */</span>
|
|
<a name="l00086"></a><a class="code" href="group__avr__math.html#gae71449b1cc6e6250b91f539153a7a0d3">00086</a> <span class="preprocessor">#define M_PI 3.14159265358979323846 </span><span class="comment">/* pi */</span>
|
|
<a name="l00087"></a>00087 <span class="comment"></span>
|
|
<a name="l00088"></a>00088 <span class="comment">/** The constant \a pi/2. */</span>
|
|
<a name="l00089"></a><a class="code" href="group__avr__math.html#ga958e4508ed28ee5cc04249144312c15f">00089</a> <span class="preprocessor">#define M_PI_2 1.57079632679489661923 </span><span class="comment">/* pi/2 */</span>
|
|
<a name="l00090"></a>00090 <span class="comment"></span>
|
|
<a name="l00091"></a>00091 <span class="comment">/** The constant \a pi/4. */</span>
|
|
<a name="l00092"></a><a class="code" href="group__avr__math.html#gaeb24420b096a677f3a2dc5a72b36bf22">00092</a> <span class="preprocessor">#define M_PI_4 0.78539816339744830962 </span><span class="comment">/* pi/4 */</span>
|
|
<a name="l00093"></a>00093 <span class="comment"></span>
|
|
<a name="l00094"></a>00094 <span class="comment">/** The constant \a 1/pi. */</span>
|
|
<a name="l00095"></a><a class="code" href="group__avr__math.html#ga08dfac3cca9601a02fc88356cc078e1d">00095</a> <span class="preprocessor">#define M_1_PI 0.31830988618379067154 </span><span class="comment">/* 1/pi */</span>
|
|
<a name="l00096"></a>00096 <span class="comment"></span>
|
|
<a name="l00097"></a>00097 <span class="comment">/** The constant \a 2/pi. */</span>
|
|
<a name="l00098"></a><a class="code" href="group__avr__math.html#ga97f6d6514d3d3dd50c3a2a6d622673db">00098</a> <span class="preprocessor">#define M_2_PI 0.63661977236758134308 </span><span class="comment">/* 2/pi */</span>
|
|
<a name="l00099"></a>00099 <span class="comment"></span>
|
|
<a name="l00100"></a>00100 <span class="comment">/** The constant \a 2/sqrt(pi). */</span>
|
|
<a name="l00101"></a><a class="code" href="group__avr__math.html#ga631ff334c4a1a6db2e8a7ff4acbe48a5">00101</a> <span class="preprocessor">#define M_2_SQRTPI 1.12837916709551257390 </span><span class="comment">/* 2/sqrt(pi) */</span>
|
|
<a name="l00102"></a>00102 <span class="comment"></span>
|
|
<a name="l00103"></a>00103 <span class="comment">/** The square root of 2. */</span>
|
|
<a name="l00104"></a><a class="code" href="group__avr__math.html#ga66b3ab30f1332874326ed93969e496e0">00104</a> <span class="preprocessor">#define M_SQRT2 1.41421356237309504880 </span><span class="comment">/* sqrt(2) */</span>
|
|
<a name="l00105"></a>00105 <span class="comment"></span>
|
|
<a name="l00106"></a>00106 <span class="comment">/** The constant \a 1/sqrt(2). */</span>
|
|
<a name="l00107"></a><a class="code" href="group__avr__math.html#gacdbb2c2f9429f08916f03c8786d2d2d7">00107</a> <span class="preprocessor">#define M_SQRT1_2 0.70710678118654752440 </span><span class="comment">/* 1/sqrt(2) */</span>
|
|
<a name="l00108"></a>00108 <span class="comment"></span>
|
|
<a name="l00109"></a>00109 <span class="comment">/** NAN constant. */</span>
|
|
<a name="l00110"></a><a class="code" href="group__avr__math.html#ga8abfcc76130f3f991d124dd22d7e69bc">00110</a> <span class="preprocessor">#define NAN __builtin_nan("")</span>
|
|
<a name="l00111"></a>00111 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00112"></a>00112 <span class="comment">/** INFINITY constant. */</span>
|
|
<a name="l00113"></a><a class="code" href="group__avr__math.html#ga956e2723d559858d08644ac99146e910">00113</a> <span class="preprocessor">#define INFINITY __builtin_inf()</span>
|
|
<a name="l00114"></a>00114 <span class="preprocessor"></span>
|
|
<a name="l00115"></a>00115
|
|
<a name="l00116"></a>00116 <span class="preprocessor">#ifndef __ATTR_CONST__</span>
|
|
<a name="l00117"></a>00117 <span class="preprocessor"></span><span class="preprocessor"># define __ATTR_CONST__ __attribute__((__const__))</span>
|
|
<a name="l00118"></a>00118 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
|
|
<a name="l00119"></a>00119 <span class="preprocessor"></span>
|
|
<a name="l00120"></a>00120 <span class="preprocessor">#ifdef __cplusplus</span>
|
|
<a name="l00121"></a>00121 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
|
|
<a name="l00122"></a>00122 <span class="preprocessor">#endif</span>
|
|
<a name="l00123"></a>00123 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00124"></a>00124 <span class="comment">/**</span>
|
|
<a name="l00125"></a>00125 <span class="comment"> The cos() function returns the cosine of \a __x, measured in radians.</span>
|
|
<a name="l00126"></a>00126 <span class="comment"> */</span>
|
|
<a name="l00127"></a>00127 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga542f5e42e0d3b5df63de0e34ec06bb40">cos</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00128"></a><a class="code" href="group__avr__math.html#gacc171f0e087ed26abd701c827944a43b">00128</a> <span class="preprocessor">#define cosf cos </span><span class="comment">/**< The alias for cos(). */</span>
|
|
<a name="l00129"></a>00129 <span class="comment"></span>
|
|
<a name="l00130"></a>00130 <span class="comment">/**</span>
|
|
<a name="l00131"></a>00131 <span class="comment"> The sin() function returns the sine of \a __x, measured in radians.</span>
|
|
<a name="l00132"></a>00132 <span class="comment"> */</span>
|
|
<a name="l00133"></a>00133 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga46e799ece7e1dd323d22cdb53c81cd73">sin</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00134"></a><a class="code" href="group__avr__math.html#ga6776b8d1a4149fe35e282a76effd8a9d">00134</a> <span class="preprocessor">#define sinf sin </span><span class="comment">/**< The alias for sin(). */</span>
|
|
<a name="l00135"></a>00135 <span class="comment"></span>
|
|
<a name="l00136"></a>00136 <span class="comment">/**</span>
|
|
<a name="l00137"></a>00137 <span class="comment"> The tan() function returns the tangent of \a __x, measured in radians.</span>
|
|
<a name="l00138"></a>00138 <span class="comment"> */</span>
|
|
<a name="l00139"></a>00139 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#gaa2c2303658b8b2555bc97cce3f806bda">tan</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00140"></a><a class="code" href="group__avr__math.html#ga841e8ff746ff8b099a00ee83d2eed1d7">00140</a> <span class="preprocessor">#define tanf tan </span><span class="comment">/**< The alias for tan(). */</span>
|
|
<a name="l00141"></a>00141 <span class="comment"></span>
|
|
<a name="l00142"></a>00142 <span class="comment">/**</span>
|
|
<a name="l00143"></a>00143 <span class="comment"> The fabs() function computes the absolute value of a floating-point</span>
|
|
<a name="l00144"></a>00144 <span class="comment"> number \a __x.</span>
|
|
<a name="l00145"></a>00145 <span class="comment"> */</span>
|
|
<a name="l00146"></a>00146 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga0838a00d86d5e920c80aa7c7532a5559">fabs</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00147"></a><a class="code" href="group__avr__math.html#ga3745ca949b1ef9df47fb2f52c2536e68">00147</a> <span class="preprocessor">#define fabsf fabs </span><span class="comment">/**< The alias for fabs(). */</span>
|
|
<a name="l00148"></a>00148 <span class="comment"></span>
|
|
<a name="l00149"></a>00149 <span class="comment">/**</span>
|
|
<a name="l00150"></a>00150 <span class="comment"> The function fmod() returns the floating-point remainder of <em>__x /</span>
|
|
<a name="l00151"></a>00151 <span class="comment"> __y</em>.</span>
|
|
<a name="l00152"></a>00152 <span class="comment"> */</span>
|
|
<a name="l00153"></a>00153 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#gaefa8edb8c13adf7fb4b6b7dbe7261a24">fmod</a>(<span class="keywordtype">double</span> __x, <span class="keywordtype">double</span> __y) __ATTR_CONST__;
|
|
<a name="l00154"></a><a class="code" href="group__avr__math.html#ga7f41f3c7a21457008063af86e4eded3a">00154</a> <span class="preprocessor">#define fmodf fmod </span><span class="comment">/**< The alias for fmod(). */</span>
|
|
<a name="l00155"></a>00155 <span class="comment"></span>
|
|
<a name="l00156"></a>00156 <span class="comment">/**</span>
|
|
<a name="l00157"></a>00157 <span class="comment"> The modf() function breaks the argument \a __x into integral and</span>
|
|
<a name="l00158"></a>00158 <span class="comment"> fractional parts, each of which has the same sign as the argument. </span>
|
|
<a name="l00159"></a>00159 <span class="comment"> It stores the integral part as a double in the object pointed to by</span>
|
|
<a name="l00160"></a>00160 <span class="comment"> \a __iptr.</span>
|
|
<a name="l00161"></a>00161 <span class="comment"></span>
|
|
<a name="l00162"></a>00162 <span class="comment"> The modf() function returns the signed fractional part of \a __x.</span>
|
|
<a name="l00163"></a>00163 <span class="comment"></span>
|
|
<a name="l00164"></a>00164 <span class="comment"> \note This implementation skips writing by zero pointer. However,</span>
|
|
<a name="l00165"></a>00165 <span class="comment"> the GCC 4.3 can replace this function with inline code that does not</span>
|
|
<a name="l00166"></a>00166 <span class="comment"> permit to use NULL address for the avoiding of storing.</span>
|
|
<a name="l00167"></a>00167 <span class="comment"> */</span>
|
|
<a name="l00168"></a>00168 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga85861fee92c0904e9bb7a9875ee77579">modf</a>(<span class="keywordtype">double</span> __x, <span class="keywordtype">double</span> *__iptr);
|
|
<a name="l00169"></a>00169 <span class="comment"></span>
|
|
<a name="l00170"></a>00170 <span class="comment">/** An alias for modf(). */</span>
|
|
<a name="l00171"></a>00171 <span class="keyword">extern</span> <span class="keywordtype">float</span> <a class="code" href="group__avr__math.html#gad180f98cb1dac86425c2f4df7faf2a15">modff</a> (<span class="keywordtype">float</span> __x, <span class="keywordtype">float</span> *__iptr);
|
|
<a name="l00172"></a>00172 <span class="comment"></span>
|
|
<a name="l00173"></a>00173 <span class="comment">/**</span>
|
|
<a name="l00174"></a>00174 <span class="comment"> The sqrt() function returns the non-negative square root of \a __x.</span>
|
|
<a name="l00175"></a>00175 <span class="comment"> */</span>
|
|
<a name="l00176"></a>00176 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#gadd1e40e370b2165c186f72ec631b1853">sqrt</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00177"></a>00177 <span class="comment"></span>
|
|
<a name="l00178"></a>00178 <span class="comment">/** An alias for sqrt(). */</span>
|
|
<a name="l00179"></a>00179 <span class="keyword">extern</span> <span class="keywordtype">float</span> <a class="code" href="group__avr__math.html#ga37bde043e94a6f074c78f10518fb5d99">sqrtf</a> (<span class="keywordtype">float</span>) __ATTR_CONST__;
|
|
<a name="l00180"></a>00180 <span class="comment"></span>
|
|
<a name="l00181"></a>00181 <span class="comment">/**</span>
|
|
<a name="l00182"></a>00182 <span class="comment"> The cbrt() function returns the cube root of \a __x.</span>
|
|
<a name="l00183"></a>00183 <span class="comment"> */</span>
|
|
<a name="l00184"></a>00184 extern <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga9dff6efc5e63405ba23afb75eb3e4af0">cbrt</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00185"></a><a class="code" href="group__avr__math.html#gad724f06c46a6f4ad699fece14f219552">00185</a> <span class="preprocessor">#define cbrtf cbrt </span><span class="comment">/**< The alias for cbrt(). */</span>
|
|
<a name="l00186"></a>00186 <span class="comment"></span>
|
|
<a name="l00187"></a>00187 <span class="comment">/**</span>
|
|
<a name="l00188"></a>00188 <span class="comment"> The hypot() function returns <em>sqrt(__x*__x + __y*__y)</em>. This</span>
|
|
<a name="l00189"></a>00189 <span class="comment"> is the length of the hypotenuse of a right triangle with sides of</span>
|
|
<a name="l00190"></a>00190 <span class="comment"> length \a __x and \a __y, or the distance of the point (\a __x, \a</span>
|
|
<a name="l00191"></a>00191 <span class="comment"> __y) from the origin. Using this function instead of the direct</span>
|
|
<a name="l00192"></a>00192 <span class="comment"> formula is wise, since the error is much smaller. No underflow with</span>
|
|
<a name="l00193"></a>00193 <span class="comment"> small \a __x and \a __y. No overflow if result is in range.</span>
|
|
<a name="l00194"></a>00194 <span class="comment"> */</span>
|
|
<a name="l00195"></a>00195 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga711412ca8746712e0f19508118bf5154">hypot</a> (<span class="keywordtype">double</span> __x, <span class="keywordtype">double</span> __y) __ATTR_CONST__;
|
|
<a name="l00196"></a><a class="code" href="group__avr__math.html#gaae0bb7cd216d5b824d90da083e67021d">00196</a> <span class="preprocessor">#define hypotf hypot </span><span class="comment">/**< The alias for hypot(). */</span>
|
|
<a name="l00197"></a>00197 <span class="comment"></span>
|
|
<a name="l00198"></a>00198 <span class="comment">/**</span>
|
|
<a name="l00199"></a>00199 <span class="comment"> The function square() returns <em>__x * __x</em>.</span>
|
|
<a name="l00200"></a>00200 <span class="comment"></span>
|
|
<a name="l00201"></a>00201 <span class="comment"> \note This function does not belong to the C standard definition.</span>
|
|
<a name="l00202"></a>00202 <span class="comment"> */</span>
|
|
<a name="l00203"></a>00203 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#gad11825ff1d6095a08b193c564d524aef">square</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00204"></a><a class="code" href="group__avr__math.html#gadd592f5a4371f7154f95df59a22f5bef">00204</a> <span class="preprocessor">#define squaref square </span><span class="comment">/**< The alias for square(). */</span>
|
|
<a name="l00205"></a>00205 <span class="comment"></span>
|
|
<a name="l00206"></a>00206 <span class="comment">/**</span>
|
|
<a name="l00207"></a>00207 <span class="comment"> The floor() function returns the largest integral value less than or</span>
|
|
<a name="l00208"></a>00208 <span class="comment"> equal to \a __x, expressed as a floating-point number.</span>
|
|
<a name="l00209"></a>00209 <span class="comment"> */</span>
|
|
<a name="l00210"></a>00210 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga0f0bf9ac2651b80846a9d9d89bd4cb85">floor</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00211"></a><a class="code" href="group__avr__math.html#ga322df600e1eaa1b96b0f994dcd49316f">00211</a> <span class="preprocessor">#define floorf floor </span><span class="comment">/**< The alias for floor(). */</span>
|
|
<a name="l00212"></a>00212 <span class="comment"></span>
|
|
<a name="l00213"></a>00213 <span class="comment">/**</span>
|
|
<a name="l00214"></a>00214 <span class="comment"> The ceil() function returns the smallest integral value greater than</span>
|
|
<a name="l00215"></a>00215 <span class="comment"> or equal to \a __x, expressed as a floating-point number.</span>
|
|
<a name="l00216"></a>00216 <span class="comment"> */</span>
|
|
<a name="l00217"></a>00217 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga61470611f23ceef5d3e9cf63d84cd8a7">ceil</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00218"></a><a class="code" href="group__avr__math.html#gadb970de70c0549110ae218f6e244c871">00218</a> <span class="preprocessor">#define ceilf ceil </span><span class="comment">/**< The alias for ceil(). */</span>
|
|
<a name="l00219"></a>00219 <span class="comment"></span>
|
|
<a name="l00220"></a>00220 <span class="comment">/**</span>
|
|
<a name="l00221"></a>00221 <span class="comment"> The frexp() function breaks a floating-point number into a normalized</span>
|
|
<a name="l00222"></a>00222 <span class="comment"> fraction and an integral power of 2. It stores the integer in the \c</span>
|
|
<a name="l00223"></a>00223 <span class="comment"> int object pointed to by \a __pexp.</span>
|
|
<a name="l00224"></a>00224 <span class="comment"></span>
|
|
<a name="l00225"></a>00225 <span class="comment"> If \a __x is a normal float point number, the frexp() function</span>
|
|
<a name="l00226"></a>00226 <span class="comment"> returns the value \c v, such that \c v has a magnitude in the</span>
|
|
<a name="l00227"></a>00227 <span class="comment"> interval [1/2, 1) or zero, and \a __x equals \c v times 2 raised to</span>
|
|
<a name="l00228"></a>00228 <span class="comment"> the power \a __pexp. If \a __x is zero, both parts of the result are</span>
|
|
<a name="l00229"></a>00229 <span class="comment"> zero. If \a __x is not a finite number, the frexp() returns \a __x as</span>
|
|
<a name="l00230"></a>00230 <span class="comment"> is and stores 0 by \a __pexp.</span>
|
|
<a name="l00231"></a>00231 <span class="comment"></span>
|
|
<a name="l00232"></a>00232 <span class="comment"> \note This implementation permits a zero pointer as a directive to</span>
|
|
<a name="l00233"></a>00233 <span class="comment"> skip a storing the exponent.</span>
|
|
<a name="l00234"></a>00234 <span class="comment"> */</span>
|
|
<a name="l00235"></a>00235 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga89f0cb053e3cdb0c9c952ef040087c80">frexp</a>(<span class="keywordtype">double</span> __x, <span class="keywordtype">int</span> *__pexp);
|
|
<a name="l00236"></a><a class="code" href="group__avr__math.html#ga23413d0a6d19da20534e53f9870cf588">00236</a> <span class="preprocessor">#define frexpf frexp </span><span class="comment">/**< The alias for frexp(). */</span>
|
|
<a name="l00237"></a>00237 <span class="comment"></span>
|
|
<a name="l00238"></a>00238 <span class="comment">/**</span>
|
|
<a name="l00239"></a>00239 <span class="comment"> The ldexp() function multiplies a floating-point number by an integral</span>
|
|
<a name="l00240"></a>00240 <span class="comment"> power of 2. It returns the value of \a __x times 2 raised to the power</span>
|
|
<a name="l00241"></a>00241 <span class="comment"> \a __exp.</span>
|
|
<a name="l00242"></a>00242 <span class="comment"> */</span>
|
|
<a name="l00243"></a>00243 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga91643e944a94341bd2a3ed1d3ffbae4f">ldexp</a>(<span class="keywordtype">double</span> __x, <span class="keywordtype">int</span> __exp) __ATTR_CONST__;
|
|
<a name="l00244"></a><a class="code" href="group__avr__math.html#ga374c9d6918a8bc1f8bbe054940795e0f">00244</a> <span class="preprocessor">#define ldexpf ldexp </span><span class="comment">/**< The alias for ldexp(). */</span>
|
|
<a name="l00245"></a>00245 <span class="comment"></span>
|
|
<a name="l00246"></a>00246 <span class="comment">/**</span>
|
|
<a name="l00247"></a>00247 <span class="comment"> The exp() function returns the exponential value of \a __x.</span>
|
|
<a name="l00248"></a>00248 <span class="comment"> */</span>
|
|
<a name="l00249"></a>00249 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga4ea549372745dda4018ab4b5a94483a6">exp</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00250"></a><a class="code" href="group__avr__math.html#ga1afc25e5db4387a8480d7cc4ed8d2e6b">00250</a> <span class="preprocessor">#define expf exp </span><span class="comment">/**< The alias for exp(). */</span>
|
|
<a name="l00251"></a>00251 <span class="comment"></span>
|
|
<a name="l00252"></a>00252 <span class="comment">/**</span>
|
|
<a name="l00253"></a>00253 <span class="comment"> The cosh() function returns the hyperbolic cosine of \a __x.</span>
|
|
<a name="l00254"></a>00254 <span class="comment"> */</span>
|
|
<a name="l00255"></a>00255 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga2ec1caf3ba3b1ba62eccb3eddf029438">cosh</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00256"></a><a class="code" href="group__avr__math.html#ga218c068c47d79563f3fdbcf0ecb45220">00256</a> <span class="preprocessor">#define coshf cosh </span><span class="comment">/**< The alias for cosh(). */</span>
|
|
<a name="l00257"></a>00257 <span class="comment"></span>
|
|
<a name="l00258"></a>00258 <span class="comment">/**</span>
|
|
<a name="l00259"></a>00259 <span class="comment"> The sinh() function returns the hyperbolic sine of \a __x.</span>
|
|
<a name="l00260"></a>00260 <span class="comment"> */</span>
|
|
<a name="l00261"></a>00261 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#gaae45da8f56ba936dc8624157d1770faa">sinh</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00262"></a><a class="code" href="group__avr__math.html#gadd3c4414cb88e4071380d6b1d6e69dcd">00262</a> <span class="preprocessor">#define sinhf sinh </span><span class="comment">/**< The alias for sinh(). */</span>
|
|
<a name="l00263"></a>00263 <span class="comment"></span>
|
|
<a name="l00264"></a>00264 <span class="comment">/**</span>
|
|
<a name="l00265"></a>00265 <span class="comment"> The tanh() function returns the hyperbolic tangent of \a __x.</span>
|
|
<a name="l00266"></a>00266 <span class="comment"> */</span>
|
|
<a name="l00267"></a>00267 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#gaf4b72825a245b794090135251f0ead22">tanh</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00268"></a><a class="code" href="group__avr__math.html#gae1308938bb768033031c381d148ad8f1">00268</a> <span class="preprocessor">#define tanhf tanh </span><span class="comment">/**< The alias for tanh(). */</span>
|
|
<a name="l00269"></a>00269 <span class="comment"></span>
|
|
<a name="l00270"></a>00270 <span class="comment">/**</span>
|
|
<a name="l00271"></a>00271 <span class="comment"> The acos() function computes the principal value of the arc cosine of</span>
|
|
<a name="l00272"></a>00272 <span class="comment"> \a __x. The returned value is in the range [0, pi] radians. A domain</span>
|
|
<a name="l00273"></a>00273 <span class="comment"> error occurs for arguments not in the range [-1, +1].</span>
|
|
<a name="l00274"></a>00274 <span class="comment"> */</span>
|
|
<a name="l00275"></a>00275 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#gae9c5790d8a29cbee8f54f8eb522decbc">acos</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00276"></a><a class="code" href="group__avr__math.html#ga3e085dcc8e09f400136816dbc2a56a25">00276</a> <span class="preprocessor">#define acosf acos </span><span class="comment">/**< The alias for acos(). */</span>
|
|
<a name="l00277"></a>00277 <span class="comment"></span>
|
|
<a name="l00278"></a>00278 <span class="comment">/**</span>
|
|
<a name="l00279"></a>00279 <span class="comment"> The asin() function computes the principal value of the arc sine of</span>
|
|
<a name="l00280"></a>00280 <span class="comment"> \a __x. The returned value is in the range [-pi/2, pi/2] radians. A</span>
|
|
<a name="l00281"></a>00281 <span class="comment"> domain error occurs for arguments not in the range [-1, +1].</span>
|
|
<a name="l00282"></a>00282 <span class="comment"> */</span>
|
|
<a name="l00283"></a>00283 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga98384ad60834911ec93ac5ae1af4cf0a">asin</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00284"></a><a class="code" href="group__avr__math.html#ga68e4969cdd396dc3d4ad5abef13880b1">00284</a> <span class="preprocessor">#define asinf asin </span><span class="comment">/**< The alias for asin(). */</span>
|
|
<a name="l00285"></a>00285 <span class="comment"></span>
|
|
<a name="l00286"></a>00286 <span class="comment">/**</span>
|
|
<a name="l00287"></a>00287 <span class="comment"> The atan() function computes the principal value of the arc tangent</span>
|
|
<a name="l00288"></a>00288 <span class="comment"> of \a __x. The returned value is in the range [-pi/2, pi/2] radians.</span>
|
|
<a name="l00289"></a>00289 <span class="comment"> */</span>
|
|
<a name="l00290"></a>00290 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga3abd1a0b68d157914a0ee01acaedfe5e">atan</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00291"></a><a class="code" href="group__avr__math.html#ga629de3dc6ca25cb7195928581f5359d2">00291</a> <span class="preprocessor">#define atanf atan </span><span class="comment">/**< The alias for atan(). */</span>
|
|
<a name="l00292"></a>00292 <span class="comment"></span>
|
|
<a name="l00293"></a>00293 <span class="comment">/**</span>
|
|
<a name="l00294"></a>00294 <span class="comment"> The atan2() function computes the principal value of the arc tangent</span>
|
|
<a name="l00295"></a>00295 <span class="comment"> of <em>__y / __x</em>, using the signs of both arguments to determine</span>
|
|
<a name="l00296"></a>00296 <span class="comment"> the quadrant of the return value. The returned value is in the range</span>
|
|
<a name="l00297"></a>00297 <span class="comment"> [-pi, +pi] radians.</span>
|
|
<a name="l00298"></a>00298 <span class="comment"> */</span>
|
|
<a name="l00299"></a>00299 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga054230cd7e4c12958dbfac75ab6886e5">atan2</a>(<span class="keywordtype">double</span> __y, <span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00300"></a><a class="code" href="group__avr__math.html#gae31ff8b5990823ebb5d9746cc0843293">00300</a> <span class="preprocessor">#define atan2f atan2 </span><span class="comment">/**< The alias for atan2(). */</span>
|
|
<a name="l00301"></a>00301 <span class="comment"></span>
|
|
<a name="l00302"></a>00302 <span class="comment">/**</span>
|
|
<a name="l00303"></a>00303 <span class="comment"> The log() function returns the natural logarithm of argument \a __x.</span>
|
|
<a name="l00304"></a>00304 <span class="comment"> */</span>
|
|
<a name="l00305"></a>00305 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga7f7d556ab6b6235777a179647c152126">log</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00306"></a><a class="code" href="group__avr__math.html#gaccce424ce6effa1bfd476479d55dde9c">00306</a> <span class="preprocessor">#define logf log </span><span class="comment">/**< The alias for log(). */</span>
|
|
<a name="l00307"></a>00307 <span class="comment"></span>
|
|
<a name="l00308"></a>00308 <span class="comment">/**</span>
|
|
<a name="l00309"></a>00309 <span class="comment"> The log10() function returns the logarithm of argument \a __x to base 10.</span>
|
|
<a name="l00310"></a>00310 <span class="comment"> */</span>
|
|
<a name="l00311"></a>00311 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga3630cb8cef4560cf0d92e82ae05b03f0">log10</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00312"></a><a class="code" href="group__avr__math.html#gaf356651f154a73fef76067055cc54c16">00312</a> <span class="preprocessor">#define log10f log10 </span><span class="comment">/**< The alias for log10(). */</span>
|
|
<a name="l00313"></a>00313 <span class="comment"></span>
|
|
<a name="l00314"></a>00314 <span class="comment">/**</span>
|
|
<a name="l00315"></a>00315 <span class="comment"> The function pow() returns the value of \a __x to the exponent \a __y.</span>
|
|
<a name="l00316"></a>00316 <span class="comment"> */</span>
|
|
<a name="l00317"></a>00317 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga41b41c307b8f96760e9c0c17180b241b">pow</a>(<span class="keywordtype">double</span> __x, <span class="keywordtype">double</span> __y) __ATTR_CONST__;
|
|
<a name="l00318"></a><a class="code" href="group__avr__math.html#gaa5a93b1934ef470b7a44ae47e6f2798b">00318</a> <span class="preprocessor">#define powf pow </span><span class="comment">/**< The alias for pow(). */</span>
|
|
<a name="l00319"></a>00319 <span class="comment"></span>
|
|
<a name="l00320"></a>00320 <span class="comment">/**</span>
|
|
<a name="l00321"></a>00321 <span class="comment"> The function isnan() returns 1 if the argument \a __x represents a</span>
|
|
<a name="l00322"></a>00322 <span class="comment"> "not-a-number" (NaN) object, otherwise 0.</span>
|
|
<a name="l00323"></a>00323 <span class="comment"> */</span>
|
|
<a name="l00324"></a>00324 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__math.html#ga468be9ed380771eca5a18e812b2470d4">isnan</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00325"></a><a class="code" href="group__avr__math.html#gaf3c3e624db1ecfe93b86972bca1dc4b3">00325</a> <span class="preprocessor">#define isnanf isnan </span><span class="comment">/**< The alias for isnan(). */</span>
|
|
<a name="l00326"></a>00326 <span class="comment"></span>
|
|
<a name="l00327"></a>00327 <span class="comment">/**</span>
|
|
<a name="l00328"></a>00328 <span class="comment"> The function isinf() returns 1 if the argument \a __x is positive</span>
|
|
<a name="l00329"></a>00329 <span class="comment"> infinity, -1 if \a __x is negative infinity, and 0 otherwise.</span>
|
|
<a name="l00330"></a>00330 <span class="comment"></span>
|
|
<a name="l00331"></a>00331 <span class="comment"> \note The GCC 4.3 can replace this function with inline code that</span>
|
|
<a name="l00332"></a>00332 <span class="comment"> returns the 1 value for both infinities (gcc bug #35509).</span>
|
|
<a name="l00333"></a>00333 <span class="comment"> */</span>
|
|
<a name="l00334"></a>00334 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__math.html#ga18a7409e0b2341afaa41993960961772">isinf</a>(<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00335"></a><a class="code" href="group__avr__math.html#gaf048a8eca1cce97556a96c532c0d2b56">00335</a> <span class="preprocessor">#define isinff isinf </span><span class="comment">/**< The alias for isinf(). */</span>
|
|
<a name="l00336"></a>00336 <span class="comment"></span>
|
|
<a name="l00337"></a>00337 <span class="comment">/**</span>
|
|
<a name="l00338"></a>00338 <span class="comment"> The isfinite() function returns a nonzero value if \a __x is finite:</span>
|
|
<a name="l00339"></a>00339 <span class="comment"> not plus or minus infinity, and not NaN.</span>
|
|
<a name="l00340"></a>00340 <span class="comment"> */</span>
|
|
<a name="l00341"></a><a class="code" href="group__avr__math.html#gafb997a6a8d6dd0498238098826998aa0">00341</a> __ATTR_CONST__ <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__math.html#gafb997a6a8d6dd0498238098826998aa0">isfinite</a> (<span class="keywordtype">double</span> __x)
|
|
<a name="l00342"></a>00342 {
|
|
<a name="l00343"></a>00343 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> __exp;
|
|
<a name="l00344"></a>00344 __asm__ (
|
|
<a name="l00345"></a>00345 <span class="stringliteral">"mov %0, %C1 \n\t"</span>
|
|
<a name="l00346"></a>00346 <span class="stringliteral">"lsl %0 \n\t"</span>
|
|
<a name="l00347"></a>00347 <span class="stringliteral">"mov %0, %D1 \n\t"</span>
|
|
<a name="l00348"></a>00348 <span class="stringliteral">"rol %0 "</span>
|
|
<a name="l00349"></a>00349 : <span class="stringliteral">"=r"</span> (__exp)
|
|
<a name="l00350"></a>00350 : <span class="stringliteral">"r"</span> (__x) );
|
|
<a name="l00351"></a>00351 <span class="keywordflow">return</span> __exp != 0xff;
|
|
<a name="l00352"></a>00352 }
|
|
<a name="l00353"></a><a class="code" href="group__avr__math.html#ga9e007830d194ee4b5f0a27d2112a0c53">00353</a> <span class="preprocessor">#define isfinitef isfinite </span><span class="comment">/**< The alias for isfinite(). */</span>
|
|
<a name="l00354"></a>00354 <span class="comment"></span>
|
|
<a name="l00355"></a>00355 <span class="comment">/**</span>
|
|
<a name="l00356"></a>00356 <span class="comment"> The copysign() function returns \a __x but with the sign of \a __y.</span>
|
|
<a name="l00357"></a>00357 <span class="comment"> They work even if \a __x or \a __y are NaN or zero.</span>
|
|
<a name="l00358"></a>00358 <span class="comment">*/</span>
|
|
<a name="l00359"></a><a class="code" href="group__avr__math.html#gaaebf29a8e50e6d8f88b6caf697021c86">00359</a> __ATTR_CONST__ <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#gaaebf29a8e50e6d8f88b6caf697021c86">copysign</a> (<span class="keywordtype">double</span> __x, <span class="keywordtype">double</span> __y)
|
|
<a name="l00360"></a>00360 {
|
|
<a name="l00361"></a>00361 __asm__ (
|
|
<a name="l00362"></a>00362 <span class="stringliteral">"bst %D2, 7 \n\t"</span>
|
|
<a name="l00363"></a>00363 <span class="stringliteral">"bld %D0, 7 "</span>
|
|
<a name="l00364"></a>00364 : <span class="stringliteral">"=r"</span> (__x)
|
|
<a name="l00365"></a>00365 : <span class="stringliteral">"0"</span> (__x), <span class="stringliteral">"r"</span> (__y) );
|
|
<a name="l00366"></a>00366 <span class="keywordflow">return</span> __x;
|
|
<a name="l00367"></a>00367 }
|
|
<a name="l00368"></a><a class="code" href="group__avr__math.html#ga1f0a9e760e0cd6faaf9619fd3aebfc3c">00368</a> <span class="preprocessor">#define copysignf copysign </span><span class="comment">/**< The alias for copysign(). */</span>
|
|
<a name="l00369"></a>00369 <span class="comment"></span>
|
|
<a name="l00370"></a>00370 <span class="comment">/**</span>
|
|
<a name="l00371"></a>00371 <span class="comment"> The signbit() function returns a nonzero value if the value of \a __x</span>
|
|
<a name="l00372"></a>00372 <span class="comment"> has its sign bit set. This is not the same as `\a __x < 0.0',</span>
|
|
<a name="l00373"></a>00373 <span class="comment"> because IEEE 754 floating point allows zero to be signed. The</span>
|
|
<a name="l00374"></a>00374 <span class="comment"> comparison `-0.0 < 0.0' is false, but `signbit (-0.0)' will return a</span>
|
|
<a name="l00375"></a>00375 <span class="comment"> nonzero value.</span>
|
|
<a name="l00376"></a>00376 <span class="comment"> */</span>
|
|
<a name="l00377"></a>00377 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__math.html#ga36894d73110fda52c84dfc050f1004bb">signbit</a> (<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00378"></a><a class="code" href="group__avr__math.html#gacff7dd1db8fe93d3e52d5bd161d8117d">00378</a> <span class="preprocessor">#define signbitf signbit </span><span class="comment">/**< The alias for signbit(). */</span>
|
|
<a name="l00379"></a>00379 <span class="comment"></span>
|
|
<a name="l00380"></a>00380 <span class="comment">/**</span>
|
|
<a name="l00381"></a>00381 <span class="comment"> The fdim() function returns <em>max(__x - __y, 0)</em>. If \a __x or</span>
|
|
<a name="l00382"></a>00382 <span class="comment"> \a __y or both are NaN, NaN is returned.</span>
|
|
<a name="l00383"></a>00383 <span class="comment"> */</span>
|
|
<a name="l00384"></a>00384 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga63fcb86a13cf17110582fd6560fb09dd">fdim</a> (<span class="keywordtype">double</span> __x, <span class="keywordtype">double</span> __y) __ATTR_CONST__;
|
|
<a name="l00385"></a><a class="code" href="group__avr__math.html#ga1305189e3aa1637d4018365c1c08698b">00385</a> <span class="preprocessor">#define fdimf fdim </span><span class="comment">/**< The alias for fdim(). */</span>
|
|
<a name="l00386"></a>00386 <span class="comment"></span>
|
|
<a name="l00387"></a>00387 <span class="comment">/**</span>
|
|
<a name="l00388"></a>00388 <span class="comment"> The fma() function performs floating-point multiply-add. This is the</span>
|
|
<a name="l00389"></a>00389 <span class="comment"> operation <em>(__x * __y) + __z</em>, but the intermediate result is</span>
|
|
<a name="l00390"></a>00390 <span class="comment"> not rounded to the destination type. This can sometimes improve the</span>
|
|
<a name="l00391"></a>00391 <span class="comment"> precision of a calculation.</span>
|
|
<a name="l00392"></a>00392 <span class="comment"> */</span>
|
|
<a name="l00393"></a>00393 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#gaf7fbeddc2e7721682e69f59be04ae9d5">fma</a> (<span class="keywordtype">double</span> __x, <span class="keywordtype">double</span> __y, <span class="keywordtype">double</span> __z) __ATTR_CONST__;
|
|
<a name="l00394"></a><a class="code" href="group__avr__math.html#ga49c61eb85541c0504867fb05e3598679">00394</a> <span class="preprocessor">#define fmaf fma </span><span class="comment">/**< The alias for fma(). */</span>
|
|
<a name="l00395"></a>00395 <span class="comment"></span>
|
|
<a name="l00396"></a>00396 <span class="comment">/**</span>
|
|
<a name="l00397"></a>00397 <span class="comment"> The fmax() function returns the greater of the two values \a __x and</span>
|
|
<a name="l00398"></a>00398 <span class="comment"> \a __y. If an argument is NaN, the other argument is returned. If</span>
|
|
<a name="l00399"></a>00399 <span class="comment"> both arguments are NaN, NaN is returned.</span>
|
|
<a name="l00400"></a>00400 <span class="comment"> */</span>
|
|
<a name="l00401"></a>00401 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#gafd8ab12e9d230e8213ac0c8b77c306d9">fmax</a> (<span class="keywordtype">double</span> __x, <span class="keywordtype">double</span> __y) __ATTR_CONST__;
|
|
<a name="l00402"></a><a class="code" href="group__avr__math.html#ga645ac7eb8b4f0d7e09bcdcadc36044d5">00402</a> <span class="preprocessor">#define fmaxf fmax </span><span class="comment">/**< The alias for fmax(). */</span>
|
|
<a name="l00403"></a>00403 <span class="comment"></span>
|
|
<a name="l00404"></a>00404 <span class="comment">/**</span>
|
|
<a name="l00405"></a>00405 <span class="comment"> The fmin() function returns the lesser of the two values \a __x and</span>
|
|
<a name="l00406"></a>00406 <span class="comment"> \a __y. If an argument is NaN, the other argument is returned. If</span>
|
|
<a name="l00407"></a>00407 <span class="comment"> both arguments are NaN, NaN is returned.</span>
|
|
<a name="l00408"></a>00408 <span class="comment"> */</span>
|
|
<a name="l00409"></a>00409 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga577eee92b9969942de4d8d134d37c7b8">fmin</a> (<span class="keywordtype">double</span> __x, <span class="keywordtype">double</span> __y) __ATTR_CONST__;
|
|
<a name="l00410"></a><a class="code" href="group__avr__math.html#gaa591e76a6dddd36f3b745dbf8c8b90a9">00410</a> <span class="preprocessor">#define fminf fmin </span><span class="comment">/**< The alias for fmin(). */</span>
|
|
<a name="l00411"></a>00411 <span class="comment"></span>
|
|
<a name="l00412"></a>00412 <span class="comment">/**</span>
|
|
<a name="l00413"></a>00413 <span class="comment"> The trunc() function rounds \a __x to the nearest integer not larger</span>
|
|
<a name="l00414"></a>00414 <span class="comment"> in absolute value.</span>
|
|
<a name="l00415"></a>00415 <span class="comment"> */</span>
|
|
<a name="l00416"></a>00416 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga1883497d16352bd92875499f1b39a4b6">trunc</a> (<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00417"></a><a class="code" href="group__avr__math.html#ga329f9e84df43e59c5999e661aeab14ec">00417</a> <span class="preprocessor">#define truncf trunc </span><span class="comment">/**< The alias for trunc(). */</span>
|
|
<a name="l00418"></a>00418 <span class="comment"></span>
|
|
<a name="l00419"></a>00419 <span class="comment">/**</span>
|
|
<a name="l00420"></a>00420 <span class="comment"> The round() function rounds \a __x to the nearest integer, but rounds</span>
|
|
<a name="l00421"></a>00421 <span class="comment"> halfway cases away from zero (instead of to the nearest even integer).</span>
|
|
<a name="l00422"></a>00422 <span class="comment"> Overflow is impossible.</span>
|
|
<a name="l00423"></a>00423 <span class="comment"></span>
|
|
<a name="l00424"></a>00424 <span class="comment"> \return The rounded value. If \a __x is an integral or infinite, \a</span>
|
|
<a name="l00425"></a>00425 <span class="comment"> __x itself is returned. If \a __x is \c NaN, then \c NaN is returned.</span>
|
|
<a name="l00426"></a>00426 <span class="comment"> */</span>
|
|
<a name="l00427"></a>00427 <span class="keyword">extern</span> <span class="keywordtype">double</span> <a class="code" href="group__avr__math.html#ga6eb04604d801054c5a2afe195d1dd75d">round</a> (<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00428"></a><a class="code" href="group__avr__math.html#gac6950642117c821388ec37e7b656a346">00428</a> <span class="preprocessor">#define roundf round </span><span class="comment">/**< The alias for round(). */</span>
|
|
<a name="l00429"></a>00429 <span class="comment"></span>
|
|
<a name="l00430"></a>00430 <span class="comment">/**</span>
|
|
<a name="l00431"></a>00431 <span class="comment"> The lround() function rounds \a __x to the nearest integer, but rounds</span>
|
|
<a name="l00432"></a>00432 <span class="comment"> halfway cases away from zero (instead of to the nearest even integer).</span>
|
|
<a name="l00433"></a>00433 <span class="comment"> This function is similar to round() function, but it differs in type of</span>
|
|
<a name="l00434"></a>00434 <span class="comment"> return value and in that an overflow is possible.</span>
|
|
<a name="l00435"></a>00435 <span class="comment"></span>
|
|
<a name="l00436"></a>00436 <span class="comment"> \return The rounded long integer value. If \a __x is not a finite number</span>
|
|
<a name="l00437"></a>00437 <span class="comment"> or an overflow was, this realization returns the \c LONG_MIN value</span>
|
|
<a name="l00438"></a>00438 <span class="comment"> (0x80000000).</span>
|
|
<a name="l00439"></a>00439 <span class="comment"> */</span>
|
|
<a name="l00440"></a>00440 <span class="keyword">extern</span> <span class="keywordtype">long</span> <a class="code" href="group__avr__math.html#gaa759c9a1684b0cf2c4c5d133771192ce">lround</a> (<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00441"></a><a class="code" href="group__avr__math.html#ga9031359ea4116de9288526c9e75fd8c2">00441</a> <span class="preprocessor">#define lroundf lround </span><span class="comment">/**< The alias for lround(). */</span>
|
|
<a name="l00442"></a>00442 <span class="comment"></span>
|
|
<a name="l00443"></a>00443 <span class="comment">/**</span>
|
|
<a name="l00444"></a>00444 <span class="comment"> The lrint() function rounds \a __x to the nearest integer, rounding the</span>
|
|
<a name="l00445"></a>00445 <span class="comment"> halfway cases to the even integer direction. (That is both 1.5 and 2.5</span>
|
|
<a name="l00446"></a>00446 <span class="comment"> values are rounded to 2). This function is similar to rint() function,</span>
|
|
<a name="l00447"></a>00447 <span class="comment"> but it differs in type of return value and in that an overflow is</span>
|
|
<a name="l00448"></a>00448 <span class="comment"> possible.</span>
|
|
<a name="l00449"></a>00449 <span class="comment"></span>
|
|
<a name="l00450"></a>00450 <span class="comment"> \return The rounded long integer value. If \a __x is not a finite</span>
|
|
<a name="l00451"></a>00451 <span class="comment"> number or an overflow was, this realization returns the \c LONG_MIN</span>
|
|
<a name="l00452"></a>00452 <span class="comment"> value (0x80000000).</span>
|
|
<a name="l00453"></a>00453 <span class="comment"> */</span>
|
|
<a name="l00454"></a>00454 <span class="keyword">extern</span> <span class="keywordtype">long</span> <a class="code" href="group__avr__math.html#ga9b995838b7bdd4886549dd7e308d0619">lrint</a> (<span class="keywordtype">double</span> __x) __ATTR_CONST__;
|
|
<a name="l00455"></a><a class="code" href="group__avr__math.html#gaaf59e045a8a86a9be3370d69dec98a25">00455</a> <span class="preprocessor">#define lrintf lrint </span><span class="comment">/**< The alias for lrint(). */</span>
|
|
<a name="l00456"></a>00456
|
|
<a name="l00457"></a>00457 <span class="preprocessor">#ifdef __cplusplus</span>
|
|
<a name="l00458"></a>00458 <span class="preprocessor"></span>}
|
|
<a name="l00459"></a>00459 <span class="preprocessor">#endif</span>
|
|
<a name="l00460"></a>00460 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00461"></a>00461 <span class="comment">/*@}*/</span>
|
|
<a name="l00462"></a>00462 <span class="preprocessor">#endif </span><span class="comment">/* !__MATH_H */</span>
|
|
</pre></div></div>
|
|
<!--- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Defines</a></div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<!-- HTML footer for doxygen 1.8.7-->
|
|
<!-- start footer part -->
|
|
<!--BEGIN GENERATE_TREEVIEW-->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
$navpath
|
|
<li class="footer">$generatedby
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> 1.6.3 </li>
|
|
</ul>
|
|
</div>
|
|
<!--END GENERATE_TREEVIEW-->
|
|
<!--BEGIN !GENERATE_TREEVIEW-->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
$generatedby  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
|
|
</a> 1.6.3
|
|
</small></address>
|
|
<!--END !GENERATE_TREEVIEW-->
|
|
</body>
|
|
</html>
|