ocaml-containers/0.21/CCFloat.html
2016-11-03 16:14:53 +01:00

213 lines
No EOL
15 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="CCBool.html">
<link rel="next" href="CCArray.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of class types" rel=Appendix href="index_class_types.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="CCVector" rel="Chapter" href="CCVector.html">
<link title="CCPrint" rel="Chapter" href="CCPrint.html">
<link title="CCError" rel="Chapter" href="CCError.html">
<link title="CCHeap" rel="Chapter" href="CCHeap.html">
<link title="CCList" rel="Chapter" href="CCList.html">
<link title="CCOpt" rel="Chapter" href="CCOpt.html">
<link title="CCPair" rel="Chapter" href="CCPair.html">
<link title="CCFun" rel="Chapter" href="CCFun.html">
<link title="CCHash" rel="Chapter" href="CCHash.html">
<link title="CCInt" rel="Chapter" href="CCInt.html">
<link title="CCBool" rel="Chapter" href="CCBool.html">
<link title="CCFloat" rel="Chapter" href="CCFloat.html">
<link title="CCArray" rel="Chapter" href="CCArray.html">
<link title="CCRef" rel="Chapter" href="CCRef.html">
<link title="CCSet" rel="Chapter" href="CCSet.html">
<link title="CCOrd" rel="Chapter" href="CCOrd.html">
<link title="CCRandom" rel="Chapter" href="CCRandom.html">
<link title="CCString" rel="Chapter" href="CCString.html">
<link title="CCHashtbl" rel="Chapter" href="CCHashtbl.html">
<link title="CCMap" rel="Chapter" href="CCMap.html">
<link title="CCFormat" rel="Chapter" href="CCFormat.html">
<link title="CCIO" rel="Chapter" href="CCIO.html">
<link title="CCInt64" rel="Chapter" href="CCInt64.html">
<link title="CCChar" rel="Chapter" href="CCChar.html">
<link title="CCResult" rel="Chapter" href="CCResult.html">
<link title="Containers" rel="Chapter" href="Containers.html">
<link title="CCKTree" rel="Chapter" href="CCKTree.html">
<link title="CCKList" rel="Chapter" href="CCKList.html">
<link title="CCLazy_list" rel="Chapter" href="CCLazy_list.html">
<link title="CCMultiMap" rel="Chapter" href="CCMultiMap.html">
<link title="CCMultiSet" rel="Chapter" href="CCMultiSet.html">
<link title="CCTrie" rel="Chapter" href="CCTrie.html">
<link title="CCFlatHashtbl" rel="Chapter" href="CCFlatHashtbl.html">
<link title="CCCache" rel="Chapter" href="CCCache.html">
<link title="CCPersistentHashtbl" rel="Chapter" href="CCPersistentHashtbl.html">
<link title="CCDeque" rel="Chapter" href="CCDeque.html">
<link title="CCFQueue" rel="Chapter" href="CCFQueue.html">
<link title="CCBV" rel="Chapter" href="CCBV.html">
<link title="CCMixtbl" rel="Chapter" href="CCMixtbl.html">
<link title="CCMixmap" rel="Chapter" href="CCMixmap.html">
<link title="CCRingBuffer" rel="Chapter" href="CCRingBuffer.html">
<link title="CCIntMap" rel="Chapter" href="CCIntMap.html">
<link title="CCPersistentArray" rel="Chapter" href="CCPersistentArray.html">
<link title="CCMixset" rel="Chapter" href="CCMixset.html">
<link title="CCHashconsedSet" rel="Chapter" href="CCHashconsedSet.html">
<link title="CCGraph" rel="Chapter" href="CCGraph.html">
<link title="CCHashSet" rel="Chapter" href="CCHashSet.html">
<link title="CCBitField" rel="Chapter" href="CCBitField.html">
<link title="CCHashTrie" rel="Chapter" href="CCHashTrie.html">
<link title="CCBloom" rel="Chapter" href="CCBloom.html">
<link title="CCWBTree" rel="Chapter" href="CCWBTree.html">
<link title="CCRAL" rel="Chapter" href="CCRAL.html">
<link title="CCAllocCache" rel="Chapter" href="CCAllocCache.html">
<link title="CCImmutArray" rel="Chapter" href="CCImmutArray.html">
<link title="CCHet" rel="Chapter" href="CCHet.html">
<link title="Containers_string" rel="Chapter" href="Containers_string.html">
<link title="CCKMP" rel="Chapter" href="CCKMP.html">
<link title="CCLevenshtein" rel="Chapter" href="CCLevenshtein.html">
<link title="CCApp_parse" rel="Chapter" href="CCApp_parse.html">
<link title="CCParse" rel="Chapter" href="CCParse.html">
<link title="CCBigstring" rel="Chapter" href="CCBigstring.html">
<link title="CCArray1" rel="Chapter" href="CCArray1.html">
<link title="CCPool" rel="Chapter" href="CCPool.html">
<link title="CCLock" rel="Chapter" href="CCLock.html">
<link title="CCSemaphore" rel="Chapter" href="CCSemaphore.html">
<link title="CCThread" rel="Chapter" href="CCThread.html">
<link title="CCBlockingQueue" rel="Chapter" href="CCBlockingQueue.html">
<link title="CCTimer" rel="Chapter" href="CCTimer.html">
<link title="Containers_advanced" rel="Chapter" href="Containers_advanced.html">
<link title="CCLinq" rel="Chapter" href="CCLinq.html">
<link title="CCBatch" rel="Chapter" href="CCBatch.html">
<link title="CCCat" rel="Chapter" href="CCCat.html">
<link title="CCMonadIO" rel="Chapter" href="CCMonadIO.html">
<link title="Containers_io_is_deprecated" rel="Chapter" href="Containers_io_is_deprecated.html">
<link title="CCUnix" rel="Chapter" href="CCUnix.html">
<link title="CCSexp" rel="Chapter" href="CCSexp.html">
<link title="CCSexpM" rel="Chapter" href="CCSexpM.html"><title>Containers doc : CCFloat</title>
</head>
<body>
<div class="navbar"><a class="pre" href="CCBool.html" title="CCBool">Previous</a>
&nbsp;<a class="up" href="index.html" title="Index">Up</a>
&nbsp;<a class="post" href="CCArray.html" title="CCArray">Next</a>
</div>
<h1>Module <a href="type_CCFloat.html">CCFloat</a></h1>
<pre><span class="keyword">module</span> CCFloat: <code class="code"><span class="keyword">sig</span></code> <a href="CCFloat.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info module top">
<h1 id="1_BasicFloatfunctions">Basic Float functions</h1><br>
<b>Since</b> 0.6.1<br>
</div>
<hr width="100%">
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = <code class="type">float</code> </pre>
<pre><span id="TYPEfpclass"><span class="keyword">type</span> <code class="type"></code>fpclass</span> = <code class="type">Pervasives.fpclass</code> = </pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTfpclass.FP_normal"><span class="constructor">FP_normal</span></span></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTfpclass.FP_subnormal"><span class="constructor">FP_subnormal</span></span></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTfpclass.FP_zero"><span class="constructor">FP_zero</span></span></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTfpclass.FP_infinite"><span class="constructor">FP_infinite</span></span></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTfpclass.FP_nan"><span class="constructor">FP_nan</span></span></code></td>
</tr></table>
<pre><span id="VALnan"><span class="keyword">val</span> nan</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALmax_value"><span class="keyword">val</span> max_value</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALmin_value"><span class="keyword">val</span> min_value</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALmax_finite_value"><span class="keyword">val</span> max_finite_value</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALepsilon"><span class="keyword">val</span> epsilon</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALis_nan"><span class="keyword">val</span> is_nan</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> bool</code></pre>
<pre><span id="VALadd"><span class="keyword">val</span> add</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALsub"><span class="keyword">val</span> sub</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALneg"><span class="keyword">val</span> neg</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALabs"><span class="keyword">val</span> abs</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALscale"><span class="keyword">val</span> scale</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALmin"><span class="keyword">val</span> min</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALmax"><span class="keyword">val</span> max</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALequal"><span class="keyword">val</span> equal</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a> -> bool</code></pre>
<pre><span id="VALcompare"><span class="keyword">val</span> compare</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a> -> int</code></pre>
<pre><span id="TYPEprinter"><span class="keyword">type</span> <code class="type">'a</code> printer</span> = <code class="type">Buffer.t -> 'a -> unit</code> </pre>
<pre><span id="TYPEformatter"><span class="keyword">type</span> <code class="type">'a</code> formatter</span> = <code class="type">Format.formatter -> 'a -> unit</code> </pre>
<pre><span id="TYPErandom_gen"><span class="keyword">type</span> <code class="type">'a</code> random_gen</span> = <code class="type">Random.State.t -> 'a</code> </pre>
<pre><span id="VALpp"><span class="keyword">val</span> pp</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> <a href="CCFloat.html#TYPEprinter">printer</a></code></pre>
<pre><span id="VALprint"><span class="keyword">val</span> print</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> <a href="CCFloat.html#TYPEformatter">formatter</a></code></pre>
<pre><span id="VALhash"><span class="keyword">val</span> hash</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> int</code></pre>
<pre><span id="VALrandom"><span class="keyword">val</span> random</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a> <a href="CCFloat.html#TYPErandom_gen">random_gen</a></code></pre>
<pre><span id="VALrandom_small"><span class="keyword">val</span> random_small</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> <a href="CCFloat.html#TYPErandom_gen">random_gen</a></code></pre>
<pre><span id="VALrandom_range"><span class="keyword">val</span> random_range</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a> <a href="CCFloat.html#TYPErandom_gen">random_gen</a></code></pre>
<pre><span id="VALfsign"><span class="keyword">val</span> fsign</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a></code></pre><div class="info ">
<code class="code">fsign x</code> is one of <code class="code">-1., -0., +0., +1.</code>, or <code class="code">nan</code> if <code class="code">x</code> is NaN.<br>
<b>Since</b> 0.7<br>
</div>
<pre><span id="VALround"><span class="keyword">val</span> round</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a></code></pre><div class="info ">
<code class="code">round f</code> returns the closest integer value, either above or below<br>
<b>Since</b> 0.20<br>
</div>
<pre><span id="EXCEPTIONTrapNaN"><span class="keyword">exception</span> TrapNaN</span> <span class="keyword">of</span> <code class="type">string</code></pre>
<pre><span id="VALsign_exn"><span class="keyword">val</span> sign_exn</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> int</code></pre><div class="info ">
<code class="code">sign_exn x</code> will return the sign of <code class="code">x</code> as <code class="code">1, 0</code> or <code class="code">-1</code>, or raise an
exception <code class="code"><span class="constructor">TrapNaN</span></code> if <code class="code">x</code> is a NaN.
Note that infinities have defined signs in OCaml.<br>
<b>Since</b> 0.7<br>
</div>
<pre><span id="VALto_int"><span class="keyword">val</span> to_int</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> int</code></pre>
<pre><span id="VALof_int"><span class="keyword">val</span> of_int</span> : <code class="type">int -> <a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALto_string"><span class="keyword">val</span> to_string</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> string</code></pre>
<pre><span id="VALof_string"><span class="keyword">val</span> of_string</span> : <code class="type">string -> <a href="CCFloat.html#TYPEt">t</a></code></pre>
<pre><span id="VALequal_precision"><span class="keyword">val</span> equal_precision</span> : <code class="type">epsilon:<a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEt">t</a> -> bool</code></pre><div class="info ">
Equality with allowed error up to a non negative epsilon value<br>
</div>
<pre><span id="VALclassify"><span class="keyword">val</span> classify</span> : <code class="type"><a href="CCFloat.html#TYPEt">t</a> -> <a href="CCFloat.html#TYPEfpclass">fpclass</a></code></pre>
<pre><span class="keyword">module</span> <a href="CCFloat.Infix.html">Infix</a>: <code class="code"><span class="keyword">sig</span></code> <a href="CCFloat.Infix.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info">
Infix Operators
</div>
<pre><span class="keyword">include</span> <a href="CCFloat.Infix.html">CCFloat.Infix</a></pre>
</body></html>