source: NonGTP/FCollada/Documentation/_f_m_float_8h-source.html @ 964

Revision 964, 5.4 KB checked in by igarcia, 18 years ago (diff)
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3<title>FCollada: FMath/FMFloat.h Source File</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5<link href="tabs.css" rel="stylesheet" type="text/css">
6</head><body>
7<!-- Generated by Doxygen 1.4.6-NO -->
8<div class="tabs">
9  <ul>
10    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
11    <li><a href="modules.html"><span>Modules</span></a></li>
12    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
13    <li><a href="classes.html"><span>Classes</span></a></li>
14    <li id="current"><a href="files.html"><span>Files</span></a></li>
15    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
16  </ul></div>
17<div class="tabs">
18  <ul>
19    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
20    <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
21  </ul></div>
22<h1>FMath/FMFloat.h</h1><a href="_f_m_float_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
23<a name="l00002"></a>00002 <span class="comment">    Copyright (C) 2005-2006 Feeling Software Inc.</span>
24<a name="l00003"></a>00003 <span class="comment">    MIT License: http://www.opensource.org/licenses/mit-license.php</span>
25<a name="l00004"></a>00004 <span class="comment">*/</span>
26<a name="l00005"></a>00005
27<a name="l00011"></a>00011 <span class="preprocessor">#ifdef WIN32</span>
28<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#include &lt;float.h&gt;</span>
29<a name="l00013"></a>00013 <span class="preprocessor">#endif</span>
30<a name="l00014"></a>00014 <span class="preprocessor"></span>
31<a name="l00016"></a><a class="code" href="_f_m_float_8h.html#3458b13111109beee2df9a2d42218678">00016</a> <span class="preprocessor">#define DBL_TOLERANCE 0.0001</span>
32<a name="l00017"></a>00017 <span class="preprocessor"></span>
33<a name="l00018"></a><a class="code" href="_f_m_float_8h.html#e1862cb712bfc3a8d5210438601b9a1b">00018</a> <span class="preprocessor">#define FLT_TOLERANCE 0.0001f</span>
34<a name="l00019"></a>00019 <span class="preprocessor"></span>
35<a name="l00021"></a><a class="code" href="_f_m_float_8h.html#a5bb580701178fb1f9f459e91ae955e2">00021</a> <span class="keyword">typedef</span> <a class="code" href="classvector.html">vector&lt;double&gt;</a> <a class="code" href="classvector.html">DoubleList</a>;
36<a name="l00022"></a>00022
37<a name="l00024"></a><a class="code" href="_f_m_float_8h.html#28301729e6656a2428b8d728fdae0e88">00024</a> <span class="keyword">typedef</span> <a class="code" href="classvector.html">vector&lt;float&gt;</a> <a class="code" href="classvector.html">FloatList</a>;
38<a name="l00025"></a>00025
39<a name="l00029"></a><a class="code" href="_f_m_float_8h.html#b6dd2a235e432f2ee271b2213446fbbf">00029</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="_f_m_array_8h.html#10854668923860f01d22d6f543c34cb2">IsEquivalent</a>(<span class="keywordtype">float</span> f1, <span class="keywordtype">float</span> f2) { <span class="keywordflow">return</span> f1 - f2 &lt; <a class="code" href="_f_m_float_8h.html#e1862cb712bfc3a8d5210438601b9a1b">FLT_TOLERANCE</a> &amp;&amp; f2 - f1 &lt; <a class="code" href="_f_m_float_8h.html#e1862cb712bfc3a8d5210438601b9a1b">FLT_TOLERANCE</a>; }
40<a name="l00030"></a>00030
41<a name="l00035"></a><a class="code" href="_f_m_float_8h.html#49839e11ca3bf4c2162665c1ec062908">00035</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="_f_m_array_8h.html#10854668923860f01d22d6f543c34cb2">IsEquivalent</a>(<span class="keywordtype">float</span> f1, <span class="keywordtype">float</span> f2, <span class="keywordtype">float</span> tolerance) { <span class="keywordflow">return</span> f1 - f2 &lt; tolerance &amp;&amp; f2 - f1 &lt; tolerance; }
42<a name="l00036"></a>00036
43<a name="l00040"></a><a class="code" href="_f_m_float_8h.html#eadaba3626e4515a4e0a7b965cb6ed25">00040</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="_f_m_array_8h.html#10854668923860f01d22d6f543c34cb2">IsEquivalent</a>(<span class="keywordtype">double</span> f1, <span class="keywordtype">double</span> f2) { <span class="keywordflow">return</span> f1 - f2 &lt; <a class="code" href="_f_m_float_8h.html#3458b13111109beee2df9a2d42218678">DBL_TOLERANCE</a> &amp;&amp; f2 - f1 &lt; <a class="code" href="_f_m_float_8h.html#3458b13111109beee2df9a2d42218678">DBL_TOLERANCE</a>; }
44<a name="l00041"></a>00041
45<a name="l00046"></a><a class="code" href="_f_m_float_8h.html#0eb5ab4f00fba07604caa7e9d2730478">00046</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="_f_m_array_8h.html#10854668923860f01d22d6f543c34cb2">IsEquivalent</a>(<span class="keywordtype">double</span> f1, <span class="keywordtype">double</span> f2, <span class="keywordtype">double</span> tolerance) { <span class="keywordflow">return</span> f1 - f2 &lt; tolerance &amp;&amp; f2 - f1 &lt; tolerance; }
46</pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri May 12 16:44:39 2006 for FCollada by&nbsp;
47<a href="http://www.doxygen.org/index.html">
48<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6-NO </small></address>
49</body>
50</html>
Note: See TracBrowser for help on using the repository browser.