Commit 8d73596b authored by Jérôme Ortais's avatar Jérôme Ortais
Browse files

Modification de la classe Fractions et adaptation du code à cette

nouvelle classe.
Amélioration du code de ex.troisiemes.affine pour qu'il utilise
pleinement les classes Fractions et polynomesCollege
parent fe62fcaf
......@@ -88,7 +88,7 @@
<span class="sd"> :rtype: integer</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">while</span> <span class="n">b</span><span class="p">:</span>
<span class="n">a</span><span class="p">,</span> <span class="n">b</span> <span class="o">=</span> <span class="n">b</span><span class="p">,</span> <span class="n">a</span><span class="o">%</span><span class="n">b</span>
<span class="n">a</span><span class="p">,</span> <span class="n">b</span> <span class="o">=</span> <span class="n">b</span><span class="p">,</span> <span class="n">a</span> <span class="o">%</span> <span class="n">b</span>
<span class="k">return</span> <span class="n">a</span>
</div>
<div class="viewcode-block" id="ppcm"><a class="viewcode-back" href="../../../pyromaths.outils.Arithmetique.html#pyromaths.outils.Arithmetique.ppcm">[docs]</a><span class="k">def</span> <span class="nf">ppcm</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">):</span>
......@@ -105,7 +105,7 @@
<span class="sd"> :rtype: integer</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">a</span><span class="o">*</span><span class="n">b</span><span class="o">/</span><span class="n">pgcd</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
<span class="k">return</span> <span class="n">a</span> <span class="o">*</span> <span class="n">b</span> <span class="o">/</span> <span class="n">pgcd</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
</div>
<div class="viewcode-block" id="premier"><a class="viewcode-back" href="../../../pyromaths.outils.Arithmetique.html#pyromaths.outils.Arithmetique.premier">[docs]</a><span class="k">def</span> <span class="nf">premier</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;**premier**\ (*n*)</span>
......@@ -121,8 +121,8 @@
<span class="sd"> :rtype: boolean</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="ow">not</span> <span class="p">[</span><span class="n">x</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">xrange</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="nb">int</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">n</span><span class="p">))</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">if</span> <span class="n">n</span><span class="o">%</span><span class="n">x</span> <span class="o">==</span> <span class="mi">0</span><span class="p">]</span>
<span class="k">return</span> <span class="ow">not</span> <span class="p">[</span><span class="n">x</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">xrange</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="nb">int</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">n</span><span class="p">))</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">if</span> <span class="n">n</span> <span class="o">%</span> <span class="n">x</span> <span class="o">==</span> <span class="mi">0</span><span class="p">]</span>
</div>
<div class="viewcode-block" id="eratosthene"><a class="viewcode-back" href="../../../pyromaths.outils.Arithmetique.html#pyromaths.outils.Arithmetique.eratosthene">[docs]</a><span class="k">def</span> <span class="nf">eratosthene</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;**eratosthene**\ (*n*)</span>
......@@ -158,12 +158,12 @@
<span class="sd"> :rtype: list</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">premiers</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">candidats</span> <span class="o">=</span> <span class="nb">xrange</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="n">n</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
<span class="n">candidats</span> <span class="o">=</span> <span class="nb">xrange</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">n</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">candidat</span> <span class="o">=</span> <span class="mi">2</span>
<span class="k">while</span> <span class="ow">not</span> <span class="n">premiers</span> <span class="ow">and</span> <span class="n">candidat</span> <span class="ow">in</span> <span class="n">candidats</span><span class="p">:</span>
<span class="k">if</span> <span class="n">n</span><span class="o">%</span><span class="n">candidat</span> <span class="o">==</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">premier</span><span class="p">(</span><span class="n">candidat</span><span class="p">):</span>
<span class="k">if</span> <span class="n">n</span> <span class="o">%</span> <span class="n">candidat</span> <span class="o">==</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">premier</span><span class="p">(</span><span class="n">candidat</span><span class="p">):</span>
<span class="n">premiers</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">candidat</span><span class="p">)</span>
<span class="n">premiers</span> <span class="o">=</span> <span class="n">premiers</span> <span class="o">+</span> <span class="n">factor</span><span class="p">(</span><span class="n">n</span><span class="o">/</span><span class="n">candidat</span><span class="p">)</span>
<span class="n">premiers</span> <span class="o">=</span> <span class="n">premiers</span> <span class="o">+</span> <span class="n">factor</span><span class="p">(</span><span class="n">n</span> <span class="o">/</span> <span class="n">candidat</span><span class="p">)</span>
<span class="n">candidat</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="k">return</span> <span class="n">premiers</span>
......@@ -184,17 +184,16 @@
<span class="sd"> :rtype: tuple</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">primes</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">temp</span> <span class="o">=</span> <span class="n">n</span>
<span class="n">etapes</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">primes_etapes</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">limite</span><span class="o">=</span><span class="nb">int</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">n</span><span class="p">))</span><span class="o">+</span><span class="mi">1</span>
<span class="n">limite</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">n</span><span class="p">))</span> <span class="o">+</span> <span class="mi">1</span>
<span class="n">candidate</span> <span class="o">=</span> <span class="mi">2</span>
<span class="k">while</span> <span class="p">(</span><span class="n">candidate</span> <span class="o">&lt;</span> <span class="n">limite</span><span class="p">):</span>
<span class="k">if</span> <span class="n">n</span> <span class="o">%</span> <span class="n">candidate</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">primes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">candidate</span><span class="p">)</span>
<span class="n">primes_etapes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">candidate</span><span class="p">))</span>
<span class="n">n</span> <span class="o">=</span> <span class="n">n</span> <span class="o">/</span> <span class="n">candidate</span>
<span class="k">if</span> <span class="n">n</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">if</span> <span class="n">n</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">break</span>
<span class="n">primes_etapes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">n</span><span class="p">))</span>
<span class="n">etapes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">primes_etapes</span><span class="p">)</span>
......@@ -257,17 +256,17 @@
<span class="sd"> :rtype: integer</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">round</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">n</span><span class="p">),</span> <span class="mi">0</span><span class="p">)</span><span class="o">==</span><span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">round</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">n</span><span class="p">),</span> <span class="mi">0</span><span class="p">)</span> <span class="o">==</span> <span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
<span class="k">return</span> <span class="mi">1</span>
<span class="k">elif</span> <span class="n">n</span><span class="o">&lt;=</span><span class="mi">0</span><span class="p">:</span>
<span class="k">elif</span> <span class="n">n</span> <span class="o">&lt;=</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">return</span> <span class="n">n</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">primes</span> <span class="o">=</span> <span class="n">factorise</span><span class="p">(</span><span class="n">n</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">q</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">for</span> <span class="n">element</span> <span class="ow">in</span> <span class="n">primes</span><span class="p">:</span>
<span class="k">if</span> <span class="p">(</span><span class="n">primes</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="n">element</span><span class="p">)</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">==</span> <span class="mi">1</span><span class="p">):</span>
<span class="n">q</span><span class="p">[</span><span class="n">element</span><span class="p">]</span><span class="o">=</span><span class="mi">1</span>
<span class="n">ncar</span><span class="o">=</span><span class="mi">1</span>
<span class="n">q</span><span class="p">[</span><span class="n">element</span><span class="p">]</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">ncar</span> <span class="o">=</span> <span class="mi">1</span>
<span class="k">for</span> <span class="n">element</span> <span class="ow">in</span> <span class="n">q</span><span class="o">.</span><span class="n">iterkeys</span><span class="p">():</span>
<span class="n">ncar</span> <span class="o">*=</span> <span class="n">element</span>
<span class="k">return</span> <span class="n">ncar</span>
......@@ -288,13 +287,13 @@
<span class="sd"> :rtype: integer</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">k</span> <span class="o">&gt;</span> <span class="n">n</span><span class="o">//</span><span class="mi">2</span><span class="p">:</span>
<span class="n">k</span> <span class="o">=</span> <span class="n">n</span><span class="o">-</span><span class="n">k</span>
<span class="k">if</span> <span class="n">k</span> <span class="o">&gt;</span> <span class="n">n</span> <span class="o">//</span> <span class="mi">2</span><span class="p">:</span>
<span class="n">k</span> <span class="o">=</span> <span class="n">n</span> <span class="o">-</span> <span class="n">k</span>
<span class="n">x</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">y</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">i</span> <span class="o">=</span> <span class="n">n</span><span class="o">-</span><span class="n">k</span><span class="o">+</span><span class="mi">1</span>
<span class="n">i</span> <span class="o">=</span> <span class="n">n</span> <span class="o">-</span> <span class="n">k</span> <span class="o">+</span> <span class="mi">1</span>
<span class="k">while</span> <span class="n">i</span> <span class="o">&lt;=</span> <span class="n">n</span><span class="p">:</span>
<span class="n">x</span> <span class="o">=</span> <span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">i</span><span class="p">)</span><span class="o">//</span><span class="n">y</span>
<span class="n">x</span> <span class="o">=</span> <span class="p">(</span><span class="n">x</span> <span class="o">*</span> <span class="n">i</span><span class="p">)</span> <span class="o">//</span> <span class="n">y</span>
<span class="n">y</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="k">return</span> <span class="n">x</span>
......@@ -343,16 +342,16 @@
<span class="c"># A supprimer dès que quatriemes/developpements.py aura été corrigé</span>
<span class="c">#---------------------------------------------------------------------</span>
</div>
<div class="viewcode-block" id="ecrit_tex"><a class="viewcode-back" href="../../../pyromaths.outils.Arithmetique.html#pyromaths.outils.Arithmetique.ecrit_tex">[docs]</a><span class="k">def</span> <span class="nf">ecrit_tex</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span> <span class="n">formule</span><span class="p">,</span> <span class="n">cadre</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">thenocalcul</span><span class="o">=</span><span class="s">&#39;</span><span class="se">\\</span><span class="s">thenocalcul = &#39;</span><span class="p">,</span>
<div class="viewcode-block" id="ecrit_tex"><a class="viewcode-back" href="../../../pyromaths.outils.Arithmetique.html#pyromaths.outils.Arithmetique.ecrit_tex">[docs]</a><span class="k">def</span> <span class="nf">ecrit_tex</span><span class="p">(</span><span class="n">fichier</span><span class="p">,</span> <span class="n">formule</span><span class="p">,</span> <span class="n">cadre</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">thenocalcul</span><span class="o">=</span><span class="s">&#39;</span><span class="se">\\</span><span class="s">thenocalcul = &#39;</span><span class="p">,</span>
<span class="n">tabs</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;**ecrit_tex**\ (*n*)</span>
<span class="sd"> **TODO :** À supprimer dès que quatriemes/developpements.py aura été corrigé</span>
<span class="sd"> Écrit `formule` dans `file`.</span>
<span class="sd"> Écrit `formule` dans `fichier`.</span>
<span class="sd"> :param file: Fichier dans lequel écrire</span>
<span class="sd"> :type file: I/O</span>
<span class="sd"> :param fichier: Fichier dans lequel écrire</span>
<span class="sd"> :type fichier: I/O</span>
<span class="sd"> :param formule: formule à insérer</span>
<span class="sd"> :type formule: string</span>
<span class="sd"> :param cadre: faut-il entourer la formule ?</span>
......@@ -362,14 +361,14 @@
<span class="sd"> :param tabs: combien de tabulation insérer pour l&#39;indentation du fichier ?</span>
<span class="sd"> :type tabs: integer</span>
<span class="sd"> :rtype: file</span>
<span class="sd"> :rtype: fichier</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">formule</span> <span class="o">!=</span> <span class="s">&#39;&#39;</span><span class="p">:</span>
<span class="k">if</span> <span class="n">cadre</span> <span class="o">==</span> <span class="bp">None</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">cadre</span><span class="p">:</span>
<span class="nb">file</span><span class="o">.</span><span class="n">write</span><span class="p">((</span><span class="s">u&#39; </span><span class="se">\\</span><span class="s">[ </span><span class="si">%s%s</span><span class="s"> </span><span class="se">\\</span><span class="s">] </span><span class="se">\n</span><span class="s">&#39;</span><span class="p">)</span> <span class="o">%</span> <span class="p">(</span><span class="n">thenocalcul</span><span class="p">,</span> <span class="n">formule</span><span class="p">))</span>
<span class="n">fichier</span><span class="o">.</span><span class="n">write</span><span class="p">((</span><span class="s">u&#39; </span><span class="se">\\</span><span class="s">[ </span><span class="si">%s%s</span><span class="s"> </span><span class="se">\\</span><span class="s">] </span><span class="se">\n</span><span class="s">&#39;</span><span class="p">)</span> <span class="o">%</span> <span class="p">(</span><span class="n">thenocalcul</span><span class="p">,</span> <span class="n">formule</span><span class="p">))</span>
<span class="k">else</span><span class="p">:</span>
<span class="nb">file</span><span class="o">.</span><span class="n">write</span><span class="p">((</span><span class="s">u&#39; </span><span class="se">\\</span><span class="s">[ </span><span class="se">\\</span><span class="s">boxed{</span><span class="si">%s%s</span><span class="s">} </span><span class="se">\\</span><span class="s">] </span><span class="se">\n</span><span class="s">&#39;</span><span class="p">)</span> <span class="o">%</span> <span class="p">(</span><span class="n">thenocalcul</span><span class="p">,</span> <span class="n">formule</span><span class="p">))</span></div>
<span class="n">fichier</span><span class="o">.</span><span class="n">write</span><span class="p">((</span><span class="s">u&#39; </span><span class="se">\\</span><span class="s">[ </span><span class="se">\\</span><span class="s">boxed{</span><span class="si">%s%s</span><span class="s">} </span><span class="se">\\</span><span class="s">] </span><span class="se">\n</span><span class="s">&#39;</span><span class="p">)</span> <span class="o">%</span> <span class="p">(</span><span class="n">thenocalcul</span><span class="p">,</span> <span class="n">formule</span><span class="p">))</span></div>
</pre></div>
</div>
......
......@@ -86,7 +86,7 @@
<span class="sd"> :rtype: float</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">alpha</span><span class="o">*</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">180</span>
<span class="k">return</span> <span class="n">alpha</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span> <span class="o">/</span> <span class="mi">180</span>
</div>
<div class="viewcode-block" id="degres"><a class="viewcode-back" href="../../../pyromaths.outils.Conversions.html#pyromaths.outils.Conversions.degres">[docs]</a><span class="k">def</span> <span class="nf">degres</span><span class="p">(</span><span class="n">alpha</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;**radians**\ (*alpha*)</span>
......@@ -103,7 +103,7 @@
<span class="sd"> :rtype: float</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">alpha</span><span class="o">*</span><span class="mi">180</span><span class="o">/</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span></div>
<span class="k">return</span> <span class="n">alpha</span> <span class="o">*</span> <span class="mi">180</span> <span class="o">/</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span></div>
</pre></div>
</div>
......
......@@ -133,9 +133,15 @@
</dl></dd>
<dt><a href="pyromaths.classes.PolynomesCollege.html#pyromaths.classes.PolynomesCollege.Polynome.__pos__">__pos__() (méthode pyromaths.classes.PolynomesCollege.Polynome)</a>
<dt><a href="pyromaths.classes.Fractions.html#pyromaths.classes.Fractions.Fraction.__pos__">__pos__() (méthode pyromaths.classes.Fractions.Fraction)</a>
</dt>
<dd><dl>
<dt><a href="pyromaths.classes.PolynomesCollege.html#pyromaths.classes.PolynomesCollege.Polynome.__pos__">(méthode pyromaths.classes.PolynomesCollege.Polynome)</a>
</dt>
</dl></dd>
<dt><a href="pyromaths.classes.Fractions.html#pyromaths.classes.Fractions.Fraction.__pow__">__pow__() (méthode pyromaths.classes.Fractions.Fraction)</a>
</dt>
......@@ -224,10 +230,14 @@
<dt><a href="pyromaths.outils.Priorites3.html#pyromaths.outils.Priorites3.cherche_classe">cherche_classe() (dans le module pyromaths.outils.Priorites3)</a>
</dt>
<dt><a href="pyromaths.outils.Priorites3.html#pyromaths.outils.Priorites3.cherche_decimal">cherche_decimal() (dans le module pyromaths.outils.Priorites3)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pyromaths.outils.Priorites3.html#pyromaths.outils.Priorites3.cherche_decimal">cherche_decimal() (dans le module pyromaths.outils.Priorites3)</a>
<dt><a href="pyromaths.outils.Priorites3.html#pyromaths.outils.Priorites3.cherche_operateur">cherche_operateur() (dans le module pyromaths.outils.Priorites3)</a>
</dt>
......@@ -268,16 +278,20 @@
<dt><a href="pyromaths.outils.Priorites3.html#pyromaths.outils.Priorites3.effectue_calcul">effectue_calcul() (dans le module pyromaths.outils.Priorites3)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pyromaths.outils.Arithmetique.html#pyromaths.outils.Arithmetique.eratosthene">eratosthene() (dans le module pyromaths.outils.Arithmetique)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pyromaths.outils.Priorites3.html#pyromaths.outils.Priorites3.EstNombre">EstNombre() (dans le module pyromaths.outils.Priorites3)</a>
</dt>
<dt><a href="pyromaths.classes.PolynomesCollege.html#pyromaths.classes.PolynomesCollege.Polynome.evaluate">evaluate() (méthode pyromaths.classes.PolynomesCollege.Polynome)</a>
</dt>
</dl></td>
</tr></table>
......@@ -448,18 +462,14 @@
<dt><a href="pyromaths.classes.Fractions.html#pyromaths.classes.Fractions.Fraction.simplifie">simplifie() (méthode pyromaths.classes.Fractions.Fraction)</a>
</dt>
<dt><a href="pyromaths.outils.Priorites3.html#pyromaths.outils.Priorites3.split_calcul">split_calcul() (dans le module pyromaths.outils.Priorites3)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pyromaths.outils.Priorites3.html#pyromaths.outils.Priorites3.splitting">splitting() (dans le module pyromaths.outils.Priorites3)</a>
<dt><a href="pyromaths.outils.Priorites3.html#pyromaths.outils.Priorites3.split_calcul">split_calcul() (dans le module pyromaths.outils.Priorites3)</a>
</dt>
<dt><a href="pyromaths.outils.Priorites3.html#pyromaths.outils.Priorites3.sympyfy">sympyfy() (dans le module pyromaths.outils.Priorites3)</a>
<dt><a href="pyromaths.outils.Priorites3.html#pyromaths.outils.Priorites3.splitting">splitting() (dans le module pyromaths.outils.Priorites3)</a>
</dt>
</dl></td>
......@@ -500,12 +510,6 @@
<dt><a href="pyromaths.outils.Arithmetique.html#pyromaths.outils.Arithmetique.valeur_alea">valeur_alea() (dans le module pyromaths.outils.Arithmetique)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pyromaths.outils.Priorites3.html#pyromaths.outils.Priorites3.valeurs">valeurs() (dans le module pyromaths.outils.Priorites3)</a>
</dt>
</dl></td>
</tr></table>
......
......@@ -61,17 +61,14 @@ permet de faire des calculs détaillés sur les polynômes.</p>
<dl class="class">
<dt id="pyromaths.classes.PolynomesCollege.Polynome">
<em class="property">class </em><tt class="descclassname">pyromaths.classes.PolynomesCollege.</tt><tt class="descname">Polynome</tt><big>(</big><em>monomes</em>, <em>var=None</em><big>)</big><a class="reference internal" href="_modules/pyromaths/classes/PolynomesCollege.html#Polynome"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyromaths.classes.PolynomesCollege.Polynome" title="Lien permanent vers cette définition"></a></dt>
<dd><dl class="docutils">
<dt>Cette classe crée la notion de polynômes.</dt>
<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyromaths.classes.PolynomesCollege</span> <span class="kn">import</span> <span class="n">Polynome</span>
<dd><p>Cette classe crée la notion de polynômes.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyromaths.classes.PolynomesCollege</span> <span class="kn">import</span> <span class="n">Polynome</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Polynome</span><span class="p">([[</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">],[</span><span class="mi">3</span><span class="p">,</span><span class="mi">1</span><span class="p">],[</span><span class="mi">4</span><span class="p">,</span><span class="mi">0</span><span class="p">]],</span> <span class="s">&#39;z&#39;</span><span class="p">)</span>
<span class="go">Polynome([[2, 2], [3, 1], [4, 0]], &quot;z&quot;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Polynome</span><span class="p">(</span><span class="s">&quot;2y^2+3y+4&quot;</span><span class="p">)</span>
<span class="go">Polynome([[2.0, 2], [3.0, 1], [4.0, 0]], &quot;y&quot;)</span>
</pre></div>
</div>
</dd>
</dl>
<p>Les variables e, i, j, l, o, O sont interdites pour des raisons de
lisibilité (l, o, O) ou parce qu&#8217;elles sont utilisées comme constantes (e,
i, j).</p>
......@@ -182,14 +179,18 @@ cette fonction ?</strong>Vérifier si elle est utilisée.</p>
<dl class="method">
<dt id="pyromaths.classes.PolynomesCollege.Polynome.__init__">
<tt class="descname">__init__</tt><big>(</big><em>monomes</em>, <em>var=None</em><big>)</big><a class="reference internal" href="_modules/pyromaths/classes/PolynomesCollege.html#Polynome.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyromaths.classes.PolynomesCollege.Polynome.__init__" title="Lien permanent vers cette définition"></a></dt>
<dd><p>Crée un polynôme. Si <tt class="docutils literal"><span class="pre">var</span> <span class="pre">==</span> <span class="pre">None</span></tt> alors la variable est <tt class="docutils literal"><span class="pre">x</span></tt>.
&gt;&gt;&gt; from pyromaths.classes.PolynomesCollege import Polynome
&gt;&gt;&gt; Polynome([[2,2],[3,1],[4,0]], &#8216;z&#8217;)
Polynome([[2, 2], [3, 1], [4, 0]], &#8220;z&#8221;)
&gt;&gt;&gt; Polynome(&#8220;2y^2+3y+4&#8221;)
Polynome([[2.0, 2], [3.0, 1], [4.0, 0]], &#8220;y&#8221;)
&gt;&gt;&gt; Polynome([[1, 1], [2, 2]])
Polynome([[1, 1], [2, 2]], &#8220;x&#8221;)</p>
<dd><p>Crée un polynôme. Si <tt class="docutils literal"><span class="pre">var</span> <span class="pre">==</span> <span class="pre">None</span></tt> alors la variable est <tt class="docutils literal"><span class="pre">x</span></tt>.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyromaths.classes.PolynomesCollege</span> <span class="kn">import</span> <span class="n">Polynome</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Polynome</span><span class="p">([[</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">],[</span><span class="mi">3</span><span class="p">,</span><span class="mi">1</span><span class="p">],[</span><span class="mi">4</span><span class="p">,</span><span class="mi">0</span><span class="p">]],</span> <span class="s">&#39;z&#39;</span><span class="p">)</span>
<span class="go">Polynome([[2, 2], [3, 1], [4, 0]], &quot;z&quot;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Polynome</span><span class="p">(</span><span class="s">&quot;2y^2+3y+4&quot;</span><span class="p">)</span>
<span class="go">Polynome([[2.0, 2], [3.0, 1], [4.0, 0]], &quot;y&quot;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Polynome</span><span class="p">([[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">]])</span>
<span class="go">Polynome([[1, 1], [2, 2]], &quot;x&quot;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Polynome</span><span class="p">(</span><span class="s">&quot;Fraction(1,7)x^2-Fraction(3,8)x-1&quot;</span><span class="p">)</span>
<span class="go">Polynome([[Fraction(1, 7), 2], [Fraction(-3, 8), 1], [-1, 0]], &quot;x&quot;)</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
......@@ -450,9 +451,10 @@ de rang 1, on effectue toutes les multiplications en une fois</li>
<dl class="docutils">
<dt>Renvoie une version LaTeX du polynôme.</dt>
<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyromaths.classes.PolynomesCollege</span> <span class="kn">import</span> <span class="n">Polynome</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">=</span><span class="n">Polynome</span><span class="p">([[</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">],[</span><span class="mi">3</span><span class="p">,</span><span class="mi">1</span><span class="p">],[</span><span class="mi">4</span><span class="p">,</span><span class="mi">0</span><span class="p">]],</span> <span class="s">&#39;z&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">str</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">str</span><span class="p">(</span><span class="n">Polynome</span><span class="p">([[</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">],[</span><span class="mi">3</span><span class="p">,</span><span class="mi">1</span><span class="p">],[</span><span class="mi">4</span><span class="p">,</span><span class="mi">0</span><span class="p">]],</span> <span class="s">&#39;z&#39;</span><span class="p">))</span>
<span class="go">&#39;2\,z^{2}+3\,z+4&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">str</span><span class="p">(</span><span class="n">Polynome</span><span class="p">(</span><span class="s">&quot;y^2-Fraction(3,2)y-1&quot;</span><span class="p">))</span>
<span class="go">&#39;y^{2}+\dfrac{-3}{2}\,y-1&#39;</span>
</pre></div>
</div>
</dd>
......@@ -496,6 +498,31 @@ de rang 1, on effectue toutes les multiplications en une fois</li>
</table>
</dd></dl>
<dl class="method">
<dt id="pyromaths.classes.PolynomesCollege.Polynome.evaluate">
<tt class="descname">evaluate</tt><big>(</big><em>valeur</em><big>)</big><a class="reference internal" href="_modules/pyromaths/classes/PolynomesCollege.html#Polynome.evaluate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyromaths.classes.PolynomesCollege.Polynome.evaluate" title="Lien permanent vers cette définition"></a></dt>
<dd><p><strong>evaluate</strong>(<em>object</em>,*valeur*)</p>
<p>Retourne l&#8217;expression numérique du polynôme pour sa variable égale à
valeur.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pyromaths.classes.PolynomesCollege</span> <span class="kn">import</span> <span class="n">Polynome</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Polynome</span><span class="o">.</span><span class="n">evaluate</span><span class="p">(</span><span class="n">Polynome</span><span class="p">(</span><span class="s">&quot;4+x-x^2+x^3-2x^5&quot;</span><span class="p">),</span> <span class="o">-</span><span class="mi">5</span><span class="p">)</span>
<span class="go">&#39;4-5-(-5)**2+(-5)**3-2*(-5)**5&#39;</span>
</pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Param :</th><td class="field-body">valeur</td>
</tr>
<tr class="field-even field"><th class="field-name">Type :</th><td class="field-body">integer, float or Fraction</td>
</tr>
<tr class="field-odd field"><th class="field-name">Type retourné:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="pyromaths.classes.PolynomesCollege.Polynome.ordonne">
<tt class="descname">ordonne</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pyromaths/classes/PolynomesCollege.html#Polynome.ordonne"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyromaths.classes.PolynomesCollege.Polynome.ordonne" title="Lien permanent vers cette définition"></a></dt>
......
Search.setIndex({objects:{"pyromaths.classes.Fractions.Fraction":{"__invert__":[3,1,1,""],simplifie:[3,1,1,""],"__str__":[3,1,1,""],"__neg__":[3,1,1,""],"__pow__":[3,1,1,""],"__radd__":[3,1,1,""],"__div__":[3,1,1,""],"__rsub__":[3,1,1,""],"__mul__":[3,1,1,""],"__add__":[3,1,1,""],"__rdiv__":[3,1,1,""],"__rmul__":[3,1,1,""],"__sub__":[3,1,1,""],reduit:[3,1,1,""],decompose:[3,1,1,""],"__repr__":[3,1,1,""]},"pyromaths.classes.PolynomesCollege":{Polynome:[5,3,1,""]},"pyromaths.outils.Priorites3":{recherche_fin_operation:[2,2,1,""],recherche_neg:[2,2,1,""],cherche_classe:[2,2,1,""],post_fractions:[2,2,1,""],EstNombre:[2,2,1,""],cherche_decimal:[2,2,1,""],sympyfy:[2,2,1,""],valeurs:[2,2,1,""],split_calcul:[2,2,1,""],splitting:[2,2,1,""],post_polynomes:[2,2,1,""],recherche_parentheses:[2,2,1,""],recherche_puissance:[2,2,1,""],recherche_produit:[2,2,1,""],priorites:[2,2,1,""],recherche_operation:[2,2,1,""],recherche_somme:[2,2,1,""],texify:[2,2,1,""],effectue_calcul:[2,2,1,""]},"pyromaths.outils.Affichage":{pTeX:[6,2,1,""],tTeX:[6,2,1,""],TeX:[6,2,1,""],fTeX:[6,2,1,""],tex_coef:[6,2,1,""],TeXz:[6,2,1,""]},"pyromaths.classes.PolynomesCollege.Polynome":{"__str__":[5,1,1,""],"__radd__":[5,1,1,""],"__rsub__":[5,1,1,""],"__rmul__":[5,1,1,""],"__init__":[5,1,1,""],"__pos__":[5,1,1,""],reduction_detaillee:[5,1,1,""],reductible:[5,1,1,""],"__len__":[5,1,1,""],"__repr__":[5,1,1,""],"__ne__":[5,1,1,""],"__getitem__":[5,1,1,""],"__pow__":[5,1,1,""],"__add__":[5,1,1,""],ordonne:[5,1,1,""],"__eq__":[5,1,1,""],"__iadd__":[5,1,1,""],degre:[5,1,1,""],"__mul__":[5,1,1,""],"__neg__":[5,1,1,""],"__sub__":[5,1,1,""],reduit:[5,1,1,""]},"pyromaths.outils.Arithmetique":{ppcm:[1,2,1,""],signe:[1,2,1,""],factorise:[1,2,1,""],valeur_alea:[1,2,1,""],carrerise:[1,2,1,""],premier:[1,2,1,""],eratosthene:[1,2,1,""],pgcd:[1,2,1,""],factor:[1,2,1,""],ecrit_tex:[1,2,1,""],combinaison:[1,2,1,""],factoriseTex:[1,2,1,""]},"pyromaths.classes.Fractions":{Fraction:[3,3,1,""]},"pyromaths.outils.Conversions":{degres:[7,2,1,""],radians:[7,2,1,""]},"pyromaths.classes":{Fractions:[3,0,1,""]},"pyromaths.outils":{Conversions:[7,0,1,""],Priorites3:[2,0,1,""],Arithmetique:[1,0,1,""],Affichage:[6,0,1,""]}},terms:{essay:0,code:[0,3],valeur_alea:1,"polyn\u00f4m":[0,8,5,2],"d\u00e9j\u00e0":[0,2],veut:1,"\u00e9gaux":5,"\u00e9tape":2,"d\u00e9compos":1,interdit:5,sympi:2,"\u00e9quival":[5,3],objet:[5,2,3],partitionn:2,sourc:[7,5,2,1,6],string:[6,5,2,1,3],prendr:2,fals:[5,1,6],sont:[0,5,2],voir:3,"pr\u00e9c\u00e9d\u00e9":2,list:[5,2,1],effectue_calcul:2,"r\u00e9duit":[5,2,3],"r\u00e9duir":5,sign:[2,1,6],tex:[2,1,6],radic:6,entr:1,permett:5,fonction:[0,1,5,2,6,7,8,9],index:[0,2],"pr\u00e9c\u00e9d\u00e9e":2,renvoi:[5,2,3],"\u00e9l\u00e9ment":[5,1],version:[5,3],sur:5,gagner:2,ordr:5,"diff\u00e9renc":[2,3],supprim:1,coeffici:[5,6],len:5,quell:2,valu:2,"m\u00eame":3,convers:[0,7,9],"__repr__":[5,3],"d\u00e9cimal":[2,6],entier:[2,1,3],action:5,changer:6,quotient:3,l_interdit:2,parmi:1,modul:[0,1,2,6,5,3,7],"boolean":[5,1,6],"num\u00e9rateur":[2,3],"arithm\u00e9tiqu":[0,1,9],combinaison:1,rationnel:[0,6,8,3],from:[1,5,2,6,7,3],doubl:6,formul:[5,1],type:[1,5,2,6,7,3],"\u00e9quivaut":5,affichag:[0,9,2,6],estnombr:2,tester:[2,1],"utilis\u00e9":5,"__str__":[5,3],moin:5,none:[5,1,3],devant:6,pour:[0,1,2,6,5,3],"g\u00e9rer":2,tabul:1,jamai:5,abord:5,objectif:[0,2,3],dfrac:[6,3],construit:[5,3],"irr\u00e9duct":3,"d\u00e9taillant":2,bienvenu:0,liter:[1,5,2,6,7,3],tab:1,suivant:5,occur:2,end:1,divis:2,"__pos__":5,"fa\u00e7on":2,frac:6,"parenth\u00e8s":[2,6],"op\u00e9rand":2,sinon:[5,2,1],carreris:1,attent:3,"d\u00e9nominateur":[2,3],permet:[6,5,3],"situ\u00e9":2,avant:2,raccourci:6,ensembl:[2,1],factorisetex:1,reduit:[5,3],"d\u00e9faut":6,cadr:1,peut:[5,2,3],"d\u00e9velopp\u00e9":0,"__rdiv__":3,afin:[0,2,3],nombr:[0,1,2,6,5,3,8],"r\u00e9el":[2,3],style:2,pens:2,p__pow__:3,soustract:2,infini:6,"op\u00e9rat":2,fin:2,tex_coef:6,non:[2,1],"__getitem__":5,dan:[0,5,2,1],"\u00e9galement":2,effectu:[5,2],autr:5,"__pow__":[5,3],introduct:[0,4],term:6,"d\u00e9taill\u00e9":[5,2,3],debut:2,entour:1,compris:1,"oppos\u00e9":[5,2,3],cett:[5,2,3],"int\u00e9rieur":2,multipl:[5,2],"cr\u00e9er":[6,5,3],recherche_oper:2,todo:[5,2,1,3],reduct:5,"\u00e9crivant":5,variabl:[5,6],respectiv:5,"d\u00e9but":2,contenu:[0,2],valeur:[2,1],bplu:6,occurr:2,math:7,"r\u00e9ductibl":5,pui:2,coef:6,post_polynom:2,compri:2,que:[2,1],factoris:[5,1],dire:2,qui:[5,2,3],indent:1,angl:7,texifi:2,place:3,"entour\u00e9":2,degr:[7,5],dont:[5,1],mise:3,affich:6,"inf\u00e9rieur":1,"\u00e9crire":[1,6],"\u00e8me":5,"effectu\u00e9":2,donn:3,fonctionn:2,avec:[6,5,2,3],racinedegre2:6,parc:5,ainsi:1,recherch:[0,2],produit:[6,5,2,3],"repr\u00e9sent":[5,3],str:[5,3],posit:2,polynomescolleg:[0,8,5],pre:[1,5,2,6,7,3],san:2,"carr\u00e9":1,premier:[5,2,1],pri:1,"__radd__":[5,3],"retourn\u00e9":[1,5,2,6,7,3],faut:[1,6],devrai:2,ftex:6,"pr\u00e9ciser":3,"priorit\u00e9":2,form:5,"\u00e9ventuel":2,self:[5,3],deux:[5,2,1,3],recherche_puiss:2,suivi:2,multipla:2,simplifi:3,begin:1,multipli:1,object:[5,3],doit:2,"v\u00e9rifier":[5,2],alpha:7,"class":[0,1,2,6,5,3,7,8],charg:2,latex:[5,1,3],"\u00e9crit":[5,1],simplif:3,cela:2,corrig:[5,3],notion:[5,3],"n\u00e9cessair":[5,2],texz:6,ajout:6,arithmetiqu:[0,1,9],"__rmul__":[5,3],"lisibilit\u00e9":5,fichier:[2,1],priorites3:[0,2,9],ptex:6,quel:[0,5],cherche_polynom:[],choisi:5,"diff\u00e9rent":5,factor:1,analys:2,"\u00e9tablit":1,express:[0,2,9],repr:[5,3],cherche_class:2,recherche_somm:2,trouver:2,"import":[1,5,2,6,7,3],ecrit_tex:1,"int\u00e9r\u00eat":5,thenocalcul:1,ordonn:5,monom:5,partir:[5,2,3],mettr:6,"d\u00e9veloppeur":0,"caract\u00e8r":[5,2,3],fait:6,fair:[5,3],"cr\u00e9e":[5,3],automatiqu:1,decompos:3,recherche_parenthes:2,nul:[5,2],particip:0,rendr:1,"\u00e9gale":2,pyromath:[0,1,2,6,5,3,7,8,9],"d\u00e9cimaux":2,facteur:1,comm:5,arrang:2,vrai:6,addit:2,"d\u00e9tail":[1,3],positif:[1,6],expos:2,alor:[5,6],tout:5,aura:1,"ins\u00e9rer":1,autour:6,"\u00e9t\u00e9":1,pow:5,devrait:5,"g\u00e8re":6,quatriem:1,"__rsub__":[5,3],cancel:3,respect:2,outil:[0,1,2,6,7,9],invers:3,tient:5,"__len__":5,"distributivit\u00e9":5,"\u00e9critur":[6,2,3],"identit\u00e9":5,laquel:2,rang:5,"__eq__":5,emploi:6,align:1,"__iadd__":5,calcul:[5,2,1,3],"__sub__":[5,3],devra:2,puissanc:[6,5,2,3],recherche_neg:2,fractionnair:3,conten:[5,2],soit:2,raison:5,"__init__":5,par:[6,5,2,1,3],"null":1,"d\u00e9pendant":5,parti:6,split:2,traiter:2,document:0,ppcm:1,"__add__":[5,3],"\u00e9valuat":[0,2,9],"bin\u00f4m":5,"modifi\u00e9":5,"encha\u00een":2,calculatoir:[0,2,9],"r\u00e9cup\u00e9rer":2,parenthes:6,lequel:1,"__div__":3,cet:2,command:6,"__neg__":[5,3],left:6,remarqu:5,newton:5,obtenir:[2,1],"al\u00e9atoir":2,rapid:2,ell:[5,2],point:5,priorit:2,param:[5,3],exempl:2,real:3,combien:1,format:[2,1,6],post_fract:2,racin:2,"d\u00e9finit":[1,3],bpc:6,docutil:[1,5,2,6,7,3],integ:[6,5,2,1,3],convertit:[7,2],recherche_fin_oper:2,page:0,"degr\u00e9":[7,5,6],"corrig\u00e9":1,dernier:[5,2],right:6,somm:[6,5,2,3],"mon\u00f4m":[5,6],born:1,polynom:[5,2],bpn:6,ici:2,est:[6,5,2,1,3],sachant:0,"\u00e9valuabl":[5,3],avoir:2,foi:[5,2],radian:7,"premi\u00e8r":2,"__ne__":5,plu:[2,1,3],split_calcul:2,cherche_decim:2,"\u00eatre":[5,2,3],permettr:0,pgcd:1,"__mul__":[5,3],"11_":3,"donn\u00e9":7,"num\u00e9rot":1,compt:5,"float":[7,1],son:3,randian:7,sou:6,retourn:[5,2,1,3],"72_":3,"n\u00e9gatif":6,span:[1,5,2,6,7,3],transform:[],avenir:2,fraction:[0,6,8,2,3],suit:[5,2],"var":[5,6],"__invert__":3,tupl:[2,1],fractex:6,"\u00e9quation":1,inclu:2,"true":[5,2,6],bug:5,temp:2,maximum:0,recherche_produit:2,"cha\u00een":[5,2,3],"simplifi\u00e9":2,constant:5,chercher:2,petit:1,utilis:[5,2,6],"op\u00e9rateur":2,file:[],"v\u00e9rifiant":2,sympyfi:2,eratosthen:1,"pr\u00e9c\u00e9dent":5,other:[5,3],test:[2,1],introduit:5,"r\u00e9guli\u00e8r":2,"int\u00e9grer":2,liste_calcul:2,developp:1,reduction_detaille:5,"sup\u00e9rieur":[5,2,1],"ordonn\u00e9":[5,2],"param\u00e8tr":[1,5,2,6,7,3],ttex:6,"d\u00e9velopp":[0,5],ignor:2,time:[1,3],"d\u00e9composit":3},objtypes:{"0":"py:module","1":"py:method","2":"py:function","3":"py:class"},titles:["Bienvenue dans la documentation de Pyromaths !","3.2. <tt class=\"docutils literal\"><span class=\"pre\">Arithmetique</span></tt> &#8212; Fonctions arithm\u00e9tiques","3.4. <tt class=\"docutils literal\"><span class=\"pre\">Priorites3</span></tt> &#8212; \u00c9valuation d&#8217;une expression calculatoire","2.1. <tt class=\"docutils literal\"><span class=\"pre\">Fractions</span></tt> &#8212; Nombres rationnels","1. Introduction","2.2. <tt class=\"docutils literal\"><span class=\"pre\">PolynomesCollege</span></tt> &#8212; Fonctions polyn\u00f4mes","3.1. <tt class=\"docutils literal\"><span class=\"pre\">Affichage</span></tt> &#8212; Fonctions d&#8217;affichage","3.3. <tt class=\"docutils literal\"><span class=\"pre\">Conversions</span></tt> &#8212; Fonctions de conversions","2. Les classes de Pyromaths","3. Les outils de Pyromaths"],objnames:{"0":["py","module","Python module"],"1":["py","method","Python m\u00e9thode"],"2":["py","function","Python fonction"],"3":["py","class","Python classe"]},filenames:["index","pyromaths.outils.Arithmetique","pyromaths.outils.Priorites3","pyromaths.classes.Fractions","intro","pyromaths.classes.PolynomesCollege","pyromaths.outils.Affichage","pyromaths.outils.Conversions","pyromaths.classes","pyromaths.outils"]})
\ No newline at end of file
Search.setIndex({objects:{"pyromaths.classes.Fractions.Fraction":{"__invert__":[3,1,1,""],"__rdiv__":[3,1,1,""],"__str__":[3,1,1,""],"__neg__":[3,1,1,""],"__radd__":[3,1,1,""],"__pos__":[3,1,1,""],"__div__":[3,1,1,""],"__mul__":[3,1,1,""],"__rsub__":[3,1,1,""],"__repr__":[3,1,1,""],"__add__":[3,1,1,""],simplifie:[3,1,1,""],"__rmul__":[3,1,1,""],"__sub__":[3,1,1,""],reduit:[3,1,1,""],decompose:[3,1,1,""],"__pow__":[3,1,1,""]},"pyromaths.outils.Arithmetique":{ppcm:[1,2,1,""],signe:[1,2,1,""],factorise:[1,2,1,""],valeur_alea:[1,2,1,""],premier:[1,2,1,""],factoriseTex:[1,2,1,""],pgcd:[1,2,1,""],factor:[1,2,1,""],combinaison:[1,2,1,""],ecrit_tex:[1,2,1,""],carrerise:[1,2,1,""],eratosthene:[1,2,1,""]},"pyromaths.outils.Priorites3":{recherche_fin_operation:[2,2,1,""],recherche_puissance:[2,2,1,""],cherche_classe:[2,2,1,""],post_fractions:[2,2,1,""],recherche_operation:[2,2,1,""],recherche_neg:[2,2,1,""],splitting:[2,2,1,""],priorites:[2,2,1,""],split_calcul:[2,2,1,""],cherche_decimal:[2,2,1,""],post_polynomes:[2,2,1,""],recherche_parentheses:[2,2,1,""],recherche_somme:[2,2,1,""],recherche_produit:[2,2,1,""],EstNombre:[2,2,1,""],cherche_operateur:[2,2,1,""],texify:[2,2,1,""],effectue_calcul:[2,2,1,""]},"pyromaths.outils.Affichage":{pTeX:[6,2,1,""],TeXz:[6,2,1,""],tTeX:[6,2,1,""],TeX:[6,2,1,""],fTeX:[6,2,1,""],tex_coef:[6,2,1,""]},"pyromaths.classes.PolynomesCollege.Polynome":{"__str__":[5,1,1,""],"__radd__":[5,1,1,""],"__rsub__":[5,1,1,""],"__rmul__":[5,1,1,""],"__init__":[5,1,1,""],"__pos__":[5,1,1,""],reduction_detaillee:[5,1,1,""],reductible:[5,1,1,""],"__len__":[5,1,1,""],"__neg__":[5,1,1,""],"__ne__":[5,1,1,""],"__getitem__":[5,1,1,""],evaluate:[5,1,1,""],"__pow__":[5,1,1,""],"__add__":[5,1,1,""],ordonne:[5,1,1,""],"__eq__":[5,1,1,""],"__iadd__":[5,1,1,""],degre:[5,1,1,""],"__mul__":[5,1,1,""],"__repr__":[5,1,1,""],"__sub__":[5,1,1,""],reduit:[5,1,1,""]},"pyromaths.outils.Conversions":{degres:[7,2,1,""],radians:[7,2,1,""]},"pyromaths.classes.Fractions":{Fraction:[3,3,1,""]},"pyromaths.classes.PolynomesCollege":{Polynome:[5,3,1,""]},"pyromaths.classes":{Fractions:[3,0,1,""]},"pyromaths.outils":{Conversions:[7,0,1,""],Arithmetique:[1,0,1,""],Priorites3:[2,0,1,""],Affichage:[6,0,1,""]}},terms:{essay:0,code:[0,3],valeur_alea:1,"polyn\u00f4m":[0,8,5,2],"d\u00e9j\u00e0":[0,2],veut:1,"\u00e9gaux":5,"\u00e9tape":2,"d\u00e9compos":1,interdit:5,"__str__":[5,3],objet:[5,2,3],"irr\u00e9duct":3,sourc:[1,5,2,6,7,3],string:[6,5,2,1,3],prendr:2,fals:[5,2,1,6],end:1,sont:[0,5,2],voir:3,"pr\u00e9c\u00e9d\u00e9":2,list:[5,2,1],effectue_calcul:2,"r\u00e9duit":[5,2,3],"r\u00e9duir":5,sign:[2,1,6],tex:[2,1,6],"__rmul__":[5,3],entr:1,permett:5,fonction:[0,1,5,2,6,7,8,9],index:[0,2],"pr\u00e9c\u00e9d\u00e9e":2,renvoi:[5,3],"\u00e9l\u00e9ment":[5,1],version:[5,3],sur:5,gagner:2,cela:2,"diff\u00e9renc":[2,3],supprim:1,coeffici:[5,6],len:5,quell:2,valu:2,"m\u00eame":3,convers:[0,7,9],"__repr__":[5,3],"d\u00e9cimal":[2,6],entier:[2,1,3],action:5,changer:6,quotient:3,l_interdit:2,parmi:1,modul:[0,1,2,6,5,3,7],"\u00e9quival":[5,3],"boolean":[5,2,1,6],"num\u00e9rateur":[2,3],"arithm\u00e9tiqu":[0,1,9],combinaison:1,rationnel:[0,6,8,3],from:[1,5,2,6,7,3],doubl:6,formul:[5,1],type:[1,5,2,6,7,3],"\u00e9quivaut":5,affichag:[0,9,2,6],"diff\u00e9rent":5,tester:[2,1],"utilis\u00e9":5,moin:5,none:[5,1],devant:6,pour:[0,1,2,6,5,3],"g\u00e9rer":2,tabul:1,jamai:5,abord:5,objectif:[0,2,3],dfrac:[6,5,3],construit:[5,3],partitionn:2,"d\u00e9taillant":2,bienvenu:0,liter:[1,5,2,6,7,3],tab:1,suivant:5,occur:2,multipl:[5,2],divis:2,"__pos__":[5,3],"fa\u00e7on":2,recherche_oper:2,"parenth\u00e8s":[2,6],"op\u00e9rand":2,sinon:[5,2,1],carreris:1,attent:3,"d\u00e9nominateur":[2,3],permet:[6,5,3],"situ\u00e9":2,avant:2,raccourci:6,ensembl:[2,1],factorisetex:1,reduit:[5,3],"d\u00e9faut":6,cadr:1,peut:[5,2,3],"d\u00e9velopp\u00e9":0,"__rdiv__":3,afin:[0,2,3],nombr:[0,1,2,6,5,3,8],"r\u00e9el":[2,3],style:2,pens:2,p__pow__:3,soustract:2,infini:6,"op\u00e9rat":2,fin:2,tex_coef:6,split:2,non:[2,1],"__getitem__":5,dan:[0,5,2,1],"\u00e9galement":2,effectu:[5,2],autr:5,"__pow__":[5,3],introduct:[0,4],term:6,"d\u00e9taill\u00e9":[5,2,3],debut:2,ordr:5,entour:1,compris:1,"oppos\u00e9":[5,2,3],cett:[5,2,3],"int\u00e9rieur":2,"cr\u00e9er":[6,5,3],frac:6,todo:[5,2,1,3],reduct:5,"\u00e9crivant":5,variabl:[5,6],respectiv:5,"d\u00e9but":2,contenu:[0,2],valeur:[5,2,1],bplu:6,occurr:2,math:7,"r\u00e9ductibl":5,pui:2,coef:6,post_polynom:2,compri:2,que:[2,1],factoris:[5,1],dire:2,qui:[5,2,3],indent:1,angl:7,texifi:2,place:3,"entour\u00e9":2,degr:[7,5],dont:[5,1],mise:3,affich:6,"inf\u00e9rieur":1,"\u00e9crire":[1,6],"\u00e8me":5,"effectu\u00e9":2,donn:3,fonctionn:2,avec:[6,5,2,3],"final":2,racinedegre2:6,parc:5,ainsi:1,recherch:[0,2],"num\u00e9riqu":5,produit:[6,5,2,3],"repr\u00e9sent":[5,3],str:[5,3],posit:2,arrang:2,pre:[1,5,2,6,7,3],san:2,"carr\u00e9":1,premier:[5,2,1],pri:1,"__radd__":[5,3],"retourn\u00e9":[1,5,2,6,7,3],faut:[1,6],devrai:2,ftex:6,"null":1,"priorit\u00e9":2,form:5,"\u00e9ventuel":2,self:[5,3],deux:[5,2,1,3],recherche_puiss:2,suivi:2,dernier:[5,2],simplifi:[2,3],begin:1,multipli:1,object:[5,3],doit:2,"v\u00e9rifier":[5,2],alpha:7,"class":[0,1,2,6,5,3,7,8],charg:2,latex:[5,1,3],"\u00e9crit":[5,1],simplif:3,corrig:[5,3],notion:[5,3],"n\u00e9cessair":[5,2],texz:6,ajout:6,arithmetiqu:[0,1,9],fini:2,radic:6,"lisibilit\u00e9":5,fichier:1,priorites3:[0,2,9],ptex:6,quel:[0,5],choisi:5,estnombr:2,factor:1,analys:2,"\u00e9tablit":1,express:[0,5,2,9],repr:[5,3],cherche_class:2,recherche_somm:2,trouver:2,"import":[1,5,2,6,7,3],ecrit_tex:1,"int\u00e9r\u00eat":5,thenocalcul:1,ordonn:5,monom:5,partir:[5,2,3],mettr:6,"d\u00e9veloppeur":0,"caract\u00e8r":[5,2,3],fait:6,fair:[5,3],"cr\u00e9e":[5,3],automatiqu:1,decompos:3,recherche_parenthes:2,nul:[5,2],particip:0,rendr:1,"\u00e9gale":[5,2],pyromath:[0,1,2,6,5,3,7,8,9],facteur:1,comm:5,polynomescolleg:[0,8,5],vrai:6,addit:2,"d\u00e9tail":[1,3],positif:[1,6],ell:[5,2],rtype:2,alor:[5,6],tout:[5,2],aura:1,"ins\u00e9rer":1,autour:6,point:5,pow:5,devrait:5,"g\u00e8re":6,quatriem:1,"__rsub__":[5,3],cancel:3,respect:2,outil:[0,1,2,6,7,9],invers:3,tient:5,"__len__":5,"distributivit\u00e9":5,restant:2,"\u00e9critur":[6,2,3],"identit\u00e9":5,laquel:2,rang:5,"__eq__":5,emploi:6,align:1,"__iadd__":5,calcul:[5,2,1,3],"__sub__":[5,3],devra:2,puissanc:[6,5,2,3],recherche_neg:2,fractionnair:3,conten:[5,2],raison:5,"__init__":5,par:[6,5,2,1,3],"pr\u00e9ciser":3,"d\u00e9pendant":5,parti:6,min_i:2,traiter:2,document:0,ppcm:1,"__add__":[5,3],"\u00e9valuat":[0,2,9],"bin\u00f4m":5,"modifi\u00e9":5,"encha\u00een":2,calculatoir:[0,2,9],"r\u00e9cup\u00e9rer":2,parenthes:6,lequel:1,"__div__":3,cet:2,command:6,"__neg__":[5,3],left:6,remarqu:5,newton:5,obtenir:[2,1],rapid:2,expos:2,"\u00e9t\u00e9":1,priorit:2,param:[5,3],exempl:2,real:3,combien:1,format:[2,1,6],post_fract:2,racin:2,"d\u00e9finit":[1,3],bpc:6,docutil:[1,5,2,6,7,3],integ:[6,5,2,1,3],convertit:[7,2],recherche_fin_oper:2,page:0,"degr\u00e9":[7,5,6],"corrig\u00e9":1,multipla:2,right:6,somm:[6,5,2,3],"mon\u00f4m":[5,6],born:1,polynom:[5,2],bpn:6,ici:2,est:[6,5,2,1,3],sachant:0,"\u00e9valuabl":[5,3],avoir:2,foi:[5,2],radian:7,"premi\u00e8r":2,"__ne__":5,plu:[2,1,3],split_calcul:2,cherche_decim:2,"\u00eatre":[5,2,3],permettr:0,pgcd:1,"__mul__":[5,3],"11_":3,"donn\u00e9":7,"num\u00e9rot":1,compt:5,"float":[7,5,1],son:3,randian:7,sou:6,retourn:[5,2,1,3],"72_":3,"n\u00e9gatif":6,span:[1,5,2,6,7,3],avenir:2,fraction:[0,2,6,5,3,8],suit:[5,2],"var":[5,6],"__invert__":3,tupl:[2,1],fractex:6,"\u00e9quation":1,inclu:2,"true":[5,2,6],bug:5,temp:2,maximum:0,recherche_produit:2,"cha\u00een":[5,2,3],"simplifi\u00e9":2,constant:5,evalu:5,chercher:2,petit:1,utilis:[5,2,6],"op\u00e9rateur":2,"v\u00e9rifiant":2,eratosthen:1,cherche_operateur:2,"pr\u00e9c\u00e9dent":5,other:[5,3],test:[2,1],introduit:5,"r\u00e9guli\u00e8r":2,"int\u00e9grer":2,liste_calcul:2,developp:1,reduction_detaille:5,"sup\u00e9rieur":[5,2,1],"ordonn\u00e9":[5,2],"param\u00e8tr":[1,5,2,6,7,3],ttex:6,"d\u00e9velopp":[0,5],ignor:2,time:[1,3],"d\u00e9composit":3},objtypes:{"0":"py:module","1":"py:method","2":"py:function","3":"py:class"},titles:["Bienvenue dans la documentation de Pyromaths !","3.2. <tt class=\"docutils literal\"><span class=\"pre\">Arithmetique</span></tt> &#8212; Fonctions arithm\u00e9tiques","3.4. <tt class=\"docutils literal\"><span class=\"pre\">Priorites3</span></tt> &#8212; \u00c9valuation d&#8217;une expression calculatoire","2.1. <tt class=\"docutils literal\"><span class=\"pre\">Fractions</span></tt> &#8212; Nombres rationnels","1. Introduction","2.2. <tt class=\"docutils literal\"><span class=\"pre\">PolynomesCollege</span></tt> &#8212; Fonctions polyn\u00f4mes","3.1. <tt class=\"docutils literal\"><span class=\"pre\">Affichage</span></tt> &#8212; Fonctions d&#8217;affichage","3.3. <tt class=\"docutils literal\"><span class=\"pre\">Conversions</span></tt> &#8212; Fonctions de conversions","2. Les classes de Pyromaths","3. Les outils de Pyromaths"],objnames:{"0":["py","module","Python module"],"1":["py","method","Python m\u00e9thode"],"2":["py","function","Python fonction"],"3":["py","class","Python classe"]},filenames:["index","pyromaths.outils.Arithmetique","pyromaths.outils.Priorites3","pyromaths.classes.Fractions","intro","pyromaths.classes.PolynomesCollege","pyromaths.outils.Affichage","pyromaths.outils.Conversions","pyromaths.classes","pyromaths.outils"]})
\ No newline at end of file
......@@ -6,7 +6,7 @@ from os.path import normpath, dirname, exists, abspath, join
from os import environ, name
from sys import executable, getfilesystemencoding
import sys
import pkgutil, types
# import pkgutil, types
import ex
def we_are_frozen():
......@@ -26,10 +26,10 @@ def data_dir():
getfilesystemencoding()))), path)
# We're alive
# Are we running from the sources?
data = join(abspath(dirname(__file__)),'../../data/')
data = join(abspath(dirname(__file__)), '../../data/')
if exists(data): return normpath(data)
# Are we running from an egg?
data = join(abspath(dirname(__file__)),'../share/pyromaths/')
data = join(abspath(dirname(__file__)), '../share/pyromaths/')
if exists(data): return normpath(data)
# Assume we're installed system-wide
return '/usr/share/pyromaths/'
......@@ -37,7 +37,7 @@ def data_dir():
def icon_dir():
"""Renvoie le dossier où se trouve l'icône, selon qu'on utilise pyromaths à
partir des sources, de l'exécutable win32 ou du paquet deb"""
if we_are_frozen() or exists(join(abspath(dirname(__file__)),'../../data/')):
if we_are_frozen() or exists(join(abspath(dirname(__file__)), '../../data/')):
return join(DATADIR, 'images', 'pyromaths.png')
return join('/usr/share/pixmaps', 'pyromaths.png')
......@@ -47,7 +47,7 @@ if name == 'nt':
def configdir():
return join(unicode(environ['APPDATA'], getfilesystemencoding()),
"pyromaths")
elif sys.platform == "darwin": #Cas de Mac OS X.
elif sys.platform