Sophie

Sophie

distrib > Mageia > 6 > i586 > media > core-release > by-pkgid > 3d21bba46faba8ab8bc0569a35594b3e > files > 38

ocaml-gg-devel-0.8.0-6.mga6.i586.rpm

<!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="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of values" rel=Appendix href="index_values.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="Gg" rel="Chapter" href="Gg.html"><link title="Floats" rel="Section" href="#float">
<link title="Vectors" rel="Section" href="#vectors">
<link title="Points" rel="Section" href="#points">
<link title="Quaternions" rel="Section" href="#quaternions">
<link title="Matrices" rel="Section" href="#matrices">
<link title="Sizes" rel="Section" href="#sizes">
<link title="Axis-aligned boxes" rel="Section" href="#aboxes">
<link title="Colors" rel="Section" href="#colors">
<link title="Raster data" rel="Section" href="#raster">
<link title="Basics" rel="Section" href="#basics">
<link title="Conventions" rel="Subsection" href="#conventions">
<link title="Mathematical conventions" rel="Subsection" href="#mathconv">
<link title="Note on colors" rel="Subsection" href="#colornote">
<link title="Remarks and Tips" rel="Subsection" href="#tipsremarks">
<title>Gg</title>
</head>
<body>
<div class="navbar">&nbsp;<a class="up" href="index.html" title="Index">Up</a>
&nbsp;</div>
<h1>Module <a href="type_Gg.html">Gg</a></h1>
<pre><span class="keyword">module</span> Gg: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info">
Basic types for computer graphics.  
<p>

    <code class="code"><span class="constructor">Gg</span></code> defines types and functions for <a href="Gg.Float.html">floats</a>,
    <a href="Gg.html#vectors">vectors</a>, <a href="Gg.html#points">points</a>, <a href="Gg.html#matrices">matrices</a>, 
    <a href="Gg.html#quaternions">quaternions</a>, <a href="Gg.html#sizes">sizes</a>, 
    <a href="Gg.html#aboxes">axis aligned boxes</a>, <a href="Gg.html#colors">colors</a>, 
    <a href="Gg.Color.html#colorprofiles">color profiles</a> and <a href="Gg.html#TYPEraster">raster data</a>.
<p>

    Consult the <a href="Gg.html#basics">basics</a>. Open the module to use it, this
    defines only modules and types in your scope. 
<p>

    <em>Release 0.8.0 - Daniel Bünzli &lt;daniel.buenzl i@erratique.ch&gt; </em><br>
</div>
<hr width="100%">
<br>
<h1 id="float">Floats</h1><br>
<pre><span class="keyword">module</span> <a href="Gg.Float.html">Float</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.Float.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info">
Floating point number utilities.
</div>
<br>
The following type are defined so that they can be used
    in vector modules. The matrix modules are <a href="Gg.html#matrices">here</a>.<br>
<pre><span id="TYPEm2"><span class="keyword">type</span> <code class="type"></code>m2</span> </pre>
<div class="info">
The type for 2x2 matrices.<br>
</div>

<pre><span id="TYPEm3"><span class="keyword">type</span> <code class="type"></code>m3</span> </pre>
<div class="info">
The type for 3x3 matrices.<br>
</div>

<pre><span id="TYPEm4"><span class="keyword">type</span> <code class="type"></code>m4</span> </pre>
<div class="info">
The type for 4x4 matrices.<br>
</div>

<br>
<h1 id="vectors">Vectors</h1> 
<p>

    An n-dimensional <em>vector</em> <code class="code">v</code> is a sequence of n, zero indexed,
    floating point <em>components</em>. We write <code class="code">v</code><sub class="subscript">i</sub> the ith component
    of a vector.<br>
<pre><span id="TYPEv2"><span class="keyword">type</span> <code class="type"></code>v2</span> </pre>
<div class="info">
The type for 2D vectors.<br>
</div>

<pre><span id="TYPEv3"><span class="keyword">type</span> <code class="type"></code>v3</span> </pre>
<div class="info">
The type for 3D vectors.<br>
</div>

<pre><span id="TYPEv4"><span class="keyword">type</span> <code class="type"></code>v4</span> </pre>
<div class="info">
The type for 4D vectors.<br>
</div>

<pre><span class="keyword">module type</span> <a href="Gg.V.html">V</a> = <code class="code"><span class="keyword">sig</span></code> <a href="Gg.V.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info">
Implemented by all vector types.
</div>
<pre><span class="keyword">module</span> <a href="Gg.V2.html">V2</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.V2.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><pre><span class="keyword">module</span> <a href="Gg.V3.html">V3</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.V3.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><pre><span class="keyword">module</span> <a href="Gg.V4.html">V4</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.V4.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><br>
<h1 id="points">Points</h1> 
<p>

    An n-dimensional <em>point</em> <code class="code">p</code> is a vector of the corresponding
    dimension. The components of the vector are the point's <em>    coordinates</em>.<br>
<pre><span id="TYPEp2"><span class="keyword">type</span> <code class="type"></code>p2</span> = <code class="type"><a href="Gg.html#TYPEv2">v2</a></code> </pre>
<div class="info">
The type for 2D points.<br>
</div>

<pre><span id="TYPEp3"><span class="keyword">type</span> <code class="type"></code>p3</span> = <code class="type"><a href="Gg.html#TYPEv3">v3</a></code> </pre>
<div class="info">
The type for 3D points.<br>
</div>

<pre><span class="keyword">module type</span> <a href="Gg.P.html">P</a> = <code class="code"><span class="keyword">sig</span></code> <a href="Gg.P.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info">
Implemented by all point types.
</div>
<pre><span class="keyword">module</span> <a href="Gg.P2.html">P2</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.P2.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><pre><span class="keyword">module</span> <a href="Gg.P3.html">P3</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.P3.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><br>
<h1 id="quaternions">Quaternions</h1> 
<p>

    Unit <a href="http://mathworld.wolfram.com/Quaternion.html">quaternions</a>
    represent rotations in 3D space. They allow to smoothly
    interpolate between orientations. A quaternion is a 4D vector,
    whose components <code class="code">x</code>, <code class="code">y</code>, <code class="code">z</code>, <code class="code">w</code> represents the quaternion
    <code class="code">x</code>i+ <code class="code">y</code>j + <code class="code">z</code>k + <code class="code">w</code>.<br>
<pre><span id="TYPEquat"><span class="keyword">type</span> <code class="type"></code>quat</span> = <code class="type"><a href="Gg.html#TYPEv4">v4</a></code> </pre>
<div class="info">
The type for quaternions.<br>
</div>

<pre><span class="keyword">module</span> <a href="Gg.Quat.html">Quat</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.Quat.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><br>
<h1 id="matrices">Matrices</h1> 
<p>

    An <em>m</em>x<em>n</em> matrix <code class="code">a</code> is an array of <em>m</em> rows and <em>n</em>
    columns of floating point <em>elements</em>. We write <code class="code">a</code><sub class="subscript">ij</sub> the
    element of <code class="code">a</code> located at the ith row and jth column.
<p>

    Matrix constructors specify matrix elements in
    <a href="http://en.wikipedia.org/wiki/Row-major_order">row-major order</a>
    so that matrix definitions look mathematically natural with proper
    code indentation. However elements are <em>stored</em> and <em>    iterated</em> over in
    <a href="http://en.wikipedia.org/wiki/Column-major_order">column-major
    order</a>.<br>
<pre><span class="keyword">module type</span> <a href="Gg.M.html">M</a> = <code class="code"><span class="keyword">sig</span></code> <a href="Gg.M.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info">
Implemented by all (square) matrix types.
</div>
<pre><span class="keyword">module</span> <a href="Gg.M2.html">M2</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.M2.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><pre><span class="keyword">module</span> <a href="Gg.M3.html">M3</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.M3.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><pre><span class="keyword">module</span> <a href="Gg.M4.html">M4</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.M4.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><br>
<h1 id="sizes">Sizes</h1> 
<p>

    An n-dimensional <em>size</em> <code class="code">s</code> represents extents in n-dimensional space.<br>
<pre><span id="TYPEsize2"><span class="keyword">type</span> <code class="type"></code>size2</span> = <code class="type"><a href="Gg.html#TYPEv2">v2</a></code> </pre>
<div class="info">
The type for sizes in 2D space.<br>
</div>

<pre><span id="TYPEsize3"><span class="keyword">type</span> <code class="type"></code>size3</span> = <code class="type"><a href="Gg.html#TYPEv3">v3</a></code> </pre>
<div class="info">
The type for sizes in 3D space.<br>
</div>

<pre><span class="keyword">module type</span> <a href="Gg.Size.html">Size</a> = <code class="code"><span class="keyword">sig</span></code> <a href="Gg.Size.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info">
Implemented by all size types.
</div>
<pre><span class="keyword">module</span> <a href="Gg.Size2.html">Size2</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.Size2.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><pre><span class="keyword">module</span> <a href="Gg.Size3.html">Size3</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.Size3.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><br>
<h1 id="aboxes">Axis-aligned boxes</h1> 
<p>

    An n-dimensional axis-aligned box <code class="code">b</code> is defined by an
    n-dimensional point <code class="code">o</code>, its <em>origin</em>, and an n-dimensional size
    <code class="code">s</code>. Operations on boxes with negative sizes are undefined.
<p>

    The space S(<code class="code">b</code>) spanned by <code class="code">b</code> is [<code class="code">o</code><sub class="subscript">0</sub>;
    <code class="code">o</code><sub class="subscript">0</sub> + <code class="code">s</code><sub class="subscript">0</sub>] x ... x [<code class="code">o</code><sub class="subscript">n-1</sub>; <code class="code">o</code><sub class="subscript">n-1</sub> +
    <code class="code">s</code><sub class="subscript">n-1</sub>]. The extremum points of this space are the box's <em>    corners</em>. There is a distinguished n-dimensional <code class="code">empty</code> box such
    that S(<code class="code">empty</code>) is empty.<br>
<pre><span id="TYPEbox2"><span class="keyword">type</span> <code class="type"></code>box2</span> </pre>
<div class="info">
The type for 2D axis-aligned boxes 
    (<a href="http://mathworld.wolfram.com/Rectangle.html">rectangles</a>).<br>
</div>

<pre><span id="TYPEbox3"><span class="keyword">type</span> <code class="type"></code>box3</span> </pre>
<div class="info">
The type for 3D axis-aligned boxes
    (<a href="http://mathworld.wolfram.com/Cuboid.html">cuboids</a>).<br>
</div>

<pre><span class="keyword">module type</span> <a href="Gg.Box.html">Box</a> = <code class="code"><span class="keyword">sig</span></code> <a href="Gg.Box.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info">
Implemented by all axis-aligned box types.
</div>
<pre><span class="keyword">module</span> <a href="Gg.Box2.html">Box2</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.Box2.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><pre><span class="keyword">module</span> <a href="Gg.Box3.html">Box3</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.Box3.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><br>
<h1 id="colors">Colors</h1><br>
<pre><span id="TYPEcolor"><span class="keyword">type</span> <code class="type"></code>color</span> = <code class="type"><a href="Gg.html#TYPEv4">v4</a></code> </pre>
<div class="info">
The type for colors, see  <a href="Gg.Color.html#TYPEt">details</a>.<br>
</div>

<pre><span class="keyword">module</span> <a href="Gg.Color.html">Color</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.Color.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info">
Colors and color profiles.
</div>
<br>
<h1 id="raster">Raster data</h1><br>
<pre><span id="TYPEraster"><span class="keyword">type</span> <code class="type"></code>raster</span> </pre>
<div class="info">
The type for raster data.<br>
</div>

<pre><span class="keyword">module</span> <a href="Gg.Raster.html">Raster</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Gg.Raster.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info">
Raster data.
</div>
<br>
<h1 id="basics">Basics</h1> 
<p>

    <code class="code"><span class="constructor">Gg</span></code> is designed to be opened in your module. This defines only
    types and modules in your scope, no values. Thus to use <code class="code"><span class="constructor">Gg</span></code> start
    with : <pre class="codepre"><code class="code"><span class="keyword">open</span>&nbsp;<span class="constructor">Gg</span></code></pre> 
<p>

    In the toplevel, if you installed <code class="code"><span class="constructor">Gg</span></code> with ocamlfind, requiring
    <code class="code"><span class="constructor">Gg</span></code>:
<pre class="codepre"><code class="code">&gt;&nbsp;<span class="keywordsign">#</span>require&nbsp;<span class="string">"gg"</span>;;<br>
</code></pre>
    automatically opens <code class="code"><span class="constructor">Gg</span></code> and installs printers for the types. 
<p>

    <h2 id="conventions">Conventions</h2>
<p>

    Most types and their functions are defined with the following
    conventions. The type is first defined in <code class="code"><span class="constructor">Gg</span></code>, like <a href="Gg.html#TYPEv2"><code class="code"><span class="constructor">Gg</span>.v2</code></a> for 2D
    vectors, a module for it follows. The name of the module is
    the type name capitalized, e.g. <a href="Gg.V2.html"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span></code></a> for 2D vectors and it has 
    the following definitions:
    <ul>
<li>a type <code class="code">t</code> equal to the original toplevel type (<a href="Gg.V2.html#TYPEt"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.t</code></a>).</li>
<li><code class="code">dim</code>, an <code class="code">int</code> value that indicates the dimensionality 
       of the type (<a href="Gg.V2.html#VALdim"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.dim</code></a>).</li>
<li><code class="code">v</code>, a constructor for the type (<a href="Gg.V2.html#VALv"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.v</code></a>).</li>
<li><code class="code">to_string</code> and <code class="code">pp</code> to convert values to a textual 
       representation for debugging purposes and toplevel interaction
       (<a href="Gg.V2.html#VALto_string"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.to_string</code></a>, <a href="Gg.V2.html#VALpp"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.pp</code></a>).</li>
<li><code class="code">equal</code> and <code class="code">compare</code> the standard functions that make a module 
       a good functor argument (<a href="Gg.V2.html#VALequal"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.equal</code></a>, <a href="Gg.V2.html#VALcompare"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.compare</code></a>).</li>
<li><code class="code">equal_f</code> and <code class="code">compare_f</code> which compare
       like <code class="code">equal</code> and <code class="code">compare</code> but allow to use a client provided
       function to compare floats (<a href="Gg.V2.html#VALequal_f"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.equal_f</code></a>, <a href="Gg.V2.html#VALcompare_f"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.compare_f</code></a>).</li>
<li><code class="code">ltr</code> and <code class="code">tr</code> to apply linear and affine transforms
       on the type (<a href="Gg.V2.html#VALltr"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.ltr</code></a>, <a href="Gg.V2.html#VALtr"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.tr</code></a>).</li>
<li>Other accessors (e.g. <a href="Gg.V2.html#VALx"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.x</code></a>), constants (e.g. <a href="Gg.V2.html#VALzero"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.zero</code></a>),
       functions (e.g. <a href="Gg.V2.html#VALdot"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.dot</code></a>) and predicates (e.g. <a href="Gg.V2.html#VALexists"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.exists</code></a>)
       specific to the type.</li>
<li>Modules that represent the same object but for different
       dimensions, like <a href="Gg.V2.html"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span></code></a>, <a href="Gg.V3.html"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V3</span></code></a>, <a href="Gg.V4.html"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V4</span></code></a> for vectors,  usually 
       share a common signature. This common
       signature is collected in a module type defined in <code class="code"><span class="constructor">Gg</span></code>, 
       this signature is <a href="Gg.V.html"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V</span></code></a> for vectors.</li>
</ul>

<p>

    Some types are defined as simple abreviations. For example the
    type <a href="Gg.html#TYPEp2"><code class="code"><span class="constructor">Gg</span>.p2</code></a> for 2D points is equal to <a href="Gg.html#TYPEv2"><code class="code"><span class="constructor">Gg</span>.v2</code></a>. These types also have
    a module whose name is the type name capitalized, <a href="Gg.P2.html"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">P2</span></code></a> in our
    example. However this module only provides alternate constructors,
    constants and accessors and the extended functionality specific to the
    type. You should fallback on the module of the abreviated type
    (<a href="Gg.V2.html"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span></code></a> in our example) for other operations. The aim of these
    types is to make your code and signatures semantically clearer
    without the burden of explicit conversions.
<p>

    Finally there are some types and modules like <a href="Gg.Color.html"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Color</span></code></a> whose structure
    is different because they provide specific functionality. 
<p>

    Here are a few other conventions : 
    <ul>
<li>Numbers in names indicate dimensionality when ambiguity can arise. 
       For example <a href="Gg.M4.html#VALscale3"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">M4</span>.scale3</code></a> indicates scale in 3D space wihle <a href="Gg.M4.html#VALscale"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">M4</span>.scale</code></a>
       scale in 4D space.</li>
<li>Most functions take the value they act upon first.
       But exceptions abound, to match OCaml conventions, to have your 
       curry or to match mathematical notation (e.g. <a href="Gg.V2.html#VALtr"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.tr</code></a>).</li>
<li>Conversion functions follow the <code class="code">of_</code> conventions. Thus to convert
       a value of type <code class="code">t'</code> to a value of type <code class="code">t</code> look for the function 
       named <code class="code"><span class="constructor">T</span>.of_t'</code>.</li>
</ul>

<p>

    To conclude note that it is sometimes hard to find the right place
    for a function. If you cannot find a function look into each of
    the modules of the types you want to act upon.
<p>

    <h2 id="mathconv">Mathematical conventions</h2>
    <ul>
<li>In 3D space we assume a
    <a href="http://mathworld.wolfram.com/Right-HandedCoordinateSystem.html">
    right-handed</a> coordinate system.</li>
<li>Angles are always given in radians (except in 
      <a href="Gg.Float.html#VALrad_of_deg">this</a> function...).</li>
<li>In 2D space positive angles determine counter clockwise rotations.</li>
<li>In 3D space positive angles determine rotations directed according to 
       the right hand rule.</li>
</ul>

<p>

    <h2 id="colornote">Note on colors</h2> 
<p>

    Values of type <a href="Gg.html#TYPEcolor"><code class="code"><span class="constructor">Gg</span>.color</code></a> are in a <em>linear</em> sRGB space as this is
    the space to work in if you want to process colors correctly (e.g.
    for blending). The constructor <a href="Gg.Color.html#VALv_srgb"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Color</span>.v_srgb</code></a> takes its parameters
    from a <em>non-linear</em> sRGB space and converts them to <em>linear</em> 
    sRGB. 
<pre class="codepre"><code class="code"><span class="keywordsign">#</span>&nbsp;<span class="keyword">let</span>&nbsp;c&nbsp;=&nbsp;<span class="constructor">Color</span>.v_srgb&nbsp;0.5&nbsp;0.5&nbsp;0.5&nbsp;1.0;;<br>
-&nbsp;:&nbsp;<span class="constructor">Gg</span>.color&nbsp;=&nbsp;(0.214041&nbsp;0.214041&nbsp;0.214041&nbsp;1)<br>
</code></pre>
    This is the constructor you are likely to use when you specify color
    constants (e.g. to specify a color value matching a CSS color). 
    If you need an sRGB color back from a <a href="Gg.html#TYPEcolor"><code class="code"><span class="constructor">Gg</span>.color</code></a> value use <a href="Gg.Color.html#VALto_srgb"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Color</span>.to_srgb</code></a>: 
<pre class="codepre"><code class="code"><span class="keywordsign">#</span>&nbsp;<span class="constructor">Color</span>.to_srgba&nbsp;c;;<br>
-&nbsp;:&nbsp;<span class="constructor">Gg</span>.<span class="constructor">Color</span>.srgba&nbsp;=&nbsp;(0.5&nbsp;0.5&nbsp;0.5&nbsp;1)<br>
</code></pre>
<p>

    <h2 id="tipsremarks">Remarks and Tips</h2>
    <ul>
<li>Everything is tail-recursive.</li>
<li><code class="code">to_string</code> functions are not thread-safe. Thread-safety can
       be achieved with <code class="code">pp</code> functions.</li>
<li>Do not rely on the output of printer functions, they are
       subject to change. The only exception is <a href="Gg.Float.html"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Float</span></code></a>'s module
       <a href="Gg.Float.html#printers">printers</a> that output a lossless textual 
       representation of floats.  While the actual format is subject to 
       change it will remain compatible with <code class="code">float_of_string</code>.</li>
<li>All modules can be directly given as arguments to <code class="code"><span class="constructor">Set</span>.<span class="constructor">Make</span></code>
       and <code class="code"><span class="constructor">Map</span>.<span class="constructor">Make</span></code>. However this will use <code class="code"><span class="constructor">Pervasives</span>.compare</code> and
       thus binary comparison between floats. Depending on the intended
       use this may be sensible or not. Comparisons with alternate functions 
       to compare floats can be defined by using the functions named 
       <code class="code">compare_f</code> (e.g. <a href="Gg.V2.html#VALcompare_f"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">V2</span>.compare_f</code></a>).  An alternate float comparison
       function is <a href="Gg.Float.html#VALcompare_tol"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Float</span>.compare_tol</code></a>
       that combines relative and absolute float comparison in a single
       test, see <a href="Gg.Float.html#VALequal_tol"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Float</span>.equal_tol</code></a> for the details.</li>
<li>For performance reasons some functions of the <a href="Gg.Float.html"><code class="code"><span class="constructor">Gg</span>.<span class="constructor">Float</span></code></a> module 
       are undefined on certain arguments but do not raise <code class="code"><span class="constructor">Invalid_argument</span></code>
       on those. As usual do not rely on the behaviour of functions on undefined
       arguments, these are subject to change.</li>
</ul>
<br>
</body></html>