add mathematics module with lcm function
This commit is contained in:
1
docs/build/html/_modules/index.html
vendored
1
docs/build/html/_modules/index.html
vendored
@@ -38,6 +38,7 @@
|
|||||||
<li><a href="function.html">function</a></li>
|
<li><a href="function.html">function</a></li>
|
||||||
<li><a href="geometry.html">geometry</a></li>
|
<li><a href="geometry.html">geometry</a></li>
|
||||||
<li><a href="geometry_plot.html">geometry_plot</a></li>
|
<li><a href="geometry_plot.html">geometry_plot</a></li>
|
||||||
|
<li><a href="mathematics.html">mathematics</a></li>
|
||||||
<li><a href="numerical/fit.html">numerical.fit</a></li>
|
<li><a href="numerical/fit.html">numerical.fit</a></li>
|
||||||
<li><a href="numerical/integration.html">numerical.integration</a></li>
|
<li><a href="numerical/integration.html">numerical.integration</a></li>
|
||||||
<li><a href="numerical/ode.html">numerical.ode</a></li>
|
<li><a href="numerical/ode.html">numerical.ode</a></li>
|
||||||
|
|||||||
116
docs/build/html/_modules/mathematics.html
vendored
Normal file
116
docs/build/html/_modules/mathematics.html
vendored
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>mathematics — pylib 2019.5.19 documentation</title>
|
||||||
|
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
|
||||||
|
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||||||
|
<script type="text/javascript" src="../_static/jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="../_static/underscore.js"></script>
|
||||||
|
<script type="text/javascript" src="../_static/doctools.js"></script>
|
||||||
|
<script type="text/javascript" src="../_static/language_data.js"></script>
|
||||||
|
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||||
|
<link rel="index" title="Index" href="../genindex.html" />
|
||||||
|
<link rel="search" title="Search" href="../search.html" />
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
|
||||||
|
|
||||||
|
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||||
|
|
||||||
|
</head><body>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="document">
|
||||||
|
<div class="documentwrapper">
|
||||||
|
<div class="bodywrapper">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="body" role="main">
|
||||||
|
|
||||||
|
<h1>Source code for mathematics</h1><div class="highlight"><pre>
|
||||||
|
<span></span><span class="ch">#!/usr/bin/env python</span>
|
||||||
|
<span class="c1"># -*- coding: utf-8 -*-</span>
|
||||||
|
<span class="sd">"""Mathematical functions.</span>
|
||||||
|
|
||||||
|
<span class="sd">:Date: 2019-10-30</span>
|
||||||
|
|
||||||
|
<span class="sd">.. module:: mathematics</span>
|
||||||
|
<span class="sd"> :platform: *nix, Windows</span>
|
||||||
|
<span class="sd"> :synopsis: Mathematical functions.</span>
|
||||||
|
|
||||||
|
<span class="sd">.. moduleauthor:: Daniel Weschke <daniel.weschke@directbox.de></span>
|
||||||
|
<span class="sd">"""</span>
|
||||||
|
<span class="kn">from</span> <span class="nn">math</span> <span class="k">import</span> <span class="n">gcd</span>
|
||||||
|
|
||||||
|
<div class="viewcode-block" id="lcm"><a class="viewcode-back" href="../mathematics.html#mathematics.lcm">[docs]</a><span class="k">def</span> <span class="nf">lcm</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="sd">"""Compute the lowest common multiple of a and b"""</span>
|
||||||
|
<span class="k">return</span> <span class="n">a</span><span class="o">/</span><span class="n">gcd</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="o">*</span><span class="n">b</span></div>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||||
|
<div class="sphinxsidebarwrapper">
|
||||||
|
<h1 class="logo"><a href="../index.html">pylib</a></h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h3>Navigation</h3>
|
||||||
|
|
||||||
|
<div class="relations">
|
||||||
|
<h3>Related Topics</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="../index.html">Documentation overview</a><ul>
|
||||||
|
<li><a href="index.html">Module code</a><ul>
|
||||||
|
</ul></li>
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="searchbox" style="display: none" role="search">
|
||||||
|
<h3 id="searchlabel">Quick search</h3>
|
||||||
|
<div class="searchformwrapper">
|
||||||
|
<form class="search" action="../search.html" method="get">
|
||||||
|
<input type="text" name="q" aria-labelledby="searchlabel" />
|
||||||
|
<input type="submit" value="Go" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="clearer"></div>
|
||||||
|
</div>
|
||||||
|
<div class="footer">
|
||||||
|
©2019, Daniel Weschke.
|
||||||
|
|
||||||
|
|
|
||||||
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.2.0</a>
|
||||||
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
7
docs/build/html/_sources/mathematics.rst.txt
vendored
Normal file
7
docs/build/html/_sources/mathematics.rst.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
mathematics module
|
||||||
|
==================
|
||||||
|
|
||||||
|
.. automodule:: mathematics
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
1
docs/build/html/_sources/modules.rst.txt
vendored
1
docs/build/html/_sources/modules.rst.txt
vendored
@@ -9,5 +9,6 @@ pylib
|
|||||||
function
|
function
|
||||||
geometry
|
geometry
|
||||||
geometry_plot
|
geometry_plot
|
||||||
|
mathematics
|
||||||
numerical
|
numerical
|
||||||
time_of_day
|
time_of_day
|
||||||
|
|||||||
6
docs/build/html/genindex.html
vendored
6
docs/build/html/genindex.html
vendored
@@ -196,6 +196,8 @@
|
|||||||
<h2 id="L">L</h2>
|
<h2 id="L">L</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
|
<li><a href="mathematics.html#mathematics.lcm">lcm() (in module mathematics)</a>
|
||||||
|
</li>
|
||||||
<li><a href="geometry.html#geometry.line">line() (in module geometry)</a>
|
<li><a href="geometry.html#geometry.line">line() (in module geometry)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
@@ -210,10 +212,12 @@
|
|||||||
<h2 id="M">M</h2>
|
<h2 id="M">M</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="time_of_day.html#time_of_day.minutes">minutes() (in module time_of_day)</a>
|
<li><a href="mathematics.html#module-mathematics">mathematics (module)</a>, <a href="mathematics.html#module-mathematics">[1]</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
|
<li><a href="time_of_day.html#time_of_day.minutes">minutes() (in module time_of_day)</a>
|
||||||
|
</li>
|
||||||
<li><a href="time_of_day.html#time_of_day.minutes_norm">minutes_norm() (in module time_of_day)</a>
|
<li><a href="time_of_day.html#time_of_day.minutes_norm">minutes_norm() (in module time_of_day)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
|
|||||||
114
docs/build/html/mathematics.html
vendored
Normal file
114
docs/build/html/mathematics.html
vendored
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>mathematics module — pylib 2019.5.19 documentation</title>
|
||||||
|
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||||
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||||
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||||
|
<script type="text/javascript" src="_static/language_data.js"></script>
|
||||||
|
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||||
|
<link rel="index" title="Index" href="genindex.html" />
|
||||||
|
<link rel="search" title="Search" href="search.html" />
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||||
|
|
||||||
|
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||||
|
|
||||||
|
</head><body>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="document">
|
||||||
|
<div class="documentwrapper">
|
||||||
|
<div class="bodywrapper">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="body" role="main">
|
||||||
|
|
||||||
|
<div class="section" id="module-mathematics">
|
||||||
|
<span id="mathematics-module"></span><h1>mathematics module<a class="headerlink" href="#module-mathematics" title="Permalink to this headline">¶</a></h1>
|
||||||
|
<p>Mathematical functions.</p>
|
||||||
|
<dl class="field-list simple">
|
||||||
|
<dt class="field-odd">Date</dt>
|
||||||
|
<dd class="field-odd"><p>2019-10-30</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<span class="target" id="module-mathematics"></span><dl class="function">
|
||||||
|
<dt id="mathematics.lcm">
|
||||||
|
<code class="sig-name descname">lcm</code><span class="sig-paren">(</span><em class="sig-param">a</em>, <em class="sig-param">b</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/mathematics.html#lcm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#mathematics.lcm" title="Permalink to this definition">¶</a></dt>
|
||||||
|
<dd><p>Compute the lowest common multiple of a and b</p>
|
||||||
|
</dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||||
|
<div class="sphinxsidebarwrapper">
|
||||||
|
<h1 class="logo"><a href="index.html">pylib</a></h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h3>Navigation</h3>
|
||||||
|
|
||||||
|
<div class="relations">
|
||||||
|
<h3>Related Topics</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="index.html">Documentation overview</a><ul>
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="searchbox" style="display: none" role="search">
|
||||||
|
<h3 id="searchlabel">Quick search</h3>
|
||||||
|
<div class="searchformwrapper">
|
||||||
|
<form class="search" action="search.html" method="get">
|
||||||
|
<input type="text" name="q" aria-labelledby="searchlabel" />
|
||||||
|
<input type="submit" value="Go" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="clearer"></div>
|
||||||
|
</div>
|
||||||
|
<div class="footer">
|
||||||
|
©2019, Daniel Weschke.
|
||||||
|
|
||||||
|
|
|
||||||
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.2.0</a>
|
||||||
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||||||
|
|
||||||
|
|
|
||||||
|
<a href="_sources/mathematics.rst.txt"
|
||||||
|
rel="nofollow">Page source</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
1
docs/build/html/modules.html
vendored
1
docs/build/html/modules.html
vendored
@@ -41,6 +41,7 @@
|
|||||||
<li class="toctree-l1"><a class="reference internal" href="function.html">function module</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="function.html">function module</a></li>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="geometry.html">geometry module</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="geometry.html">geometry module</a></li>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="geometry_plot.html">geometry_plot module</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="geometry_plot.html">geometry_plot module</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="mathematics.html">mathematics module</a></li>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="numerical.html">numerical package</a><ul>
|
<li class="toctree-l1"><a class="reference internal" href="numerical.html">numerical package</a><ul>
|
||||||
<li class="toctree-l2"><a class="reference internal" href="numerical.html#submodules">Submodules</a></li>
|
<li class="toctree-l2"><a class="reference internal" href="numerical.html#submodules">Submodules</a></li>
|
||||||
<li class="toctree-l2"><a class="reference internal" href="numerical.html#module-numerical.fit">numerical.fit module</a></li>
|
<li class="toctree-l2"><a class="reference internal" href="numerical.html#module-numerical.fit">numerical.fit module</a></li>
|
||||||
|
|||||||
BIN
docs/build/html/objects.inv
vendored
BIN
docs/build/html/objects.inv
vendored
Binary file not shown.
9
docs/build/html/py-modindex.html
vendored
9
docs/build/html/py-modindex.html
vendored
@@ -47,6 +47,7 @@
|
|||||||
<a href="#cap-f"><strong>f</strong></a> |
|
<a href="#cap-f"><strong>f</strong></a> |
|
||||||
<a href="#cap-g"><strong>g</strong></a> |
|
<a href="#cap-g"><strong>g</strong></a> |
|
||||||
<a href="#cap-i"><strong>i</strong></a> |
|
<a href="#cap-i"><strong>i</strong></a> |
|
||||||
|
<a href="#cap-m"><strong>m</strong></a> |
|
||||||
<a href="#cap-n"><strong>n</strong></a> |
|
<a href="#cap-n"><strong>n</strong></a> |
|
||||||
<a href="#cap-o"><strong>o</strong></a> |
|
<a href="#cap-o"><strong>o</strong></a> |
|
||||||
<a href="#cap-t"><strong>t</strong></a>
|
<a href="#cap-t"><strong>t</strong></a>
|
||||||
@@ -101,6 +102,14 @@
|
|||||||
<a href="numerical.html#module-integration"><code class="xref">integration</code></a> <em>(*nix, Windows)</em></td><td>
|
<a href="numerical.html#module-integration"><code class="xref">integration</code></a> <em>(*nix, Windows)</em></td><td>
|
||||||
<em>Numerical integration.</em></td></tr>
|
<em>Numerical integration.</em></td></tr>
|
||||||
<tr class="pcap"><td></td><td> </td><td></td></tr>
|
<tr class="pcap"><td></td><td> </td><td></td></tr>
|
||||||
|
<tr class="cap" id="cap-m"><td></td><td>
|
||||||
|
<strong>m</strong></td><td></td></tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<a href="mathematics.html#module-mathematics"><code class="xref">mathematics</code></a> <em>(*nix, Windows)</em></td><td>
|
||||||
|
<em>Mathematical functions.</em></td></tr>
|
||||||
|
<tr class="pcap"><td></td><td> </td><td></td></tr>
|
||||||
<tr class="cap" id="cap-n"><td></td><td>
|
<tr class="cap" id="cap-n"><td></td><td>
|
||||||
<strong>n</strong></td><td></td></tr>
|
<strong>n</strong></td><td></td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
2
docs/build/html/searchindex.js
vendored
2
docs/build/html/searchindex.js
vendored
File diff suppressed because one or more lines are too long
7
docs/source/mathematics.rst
Normal file
7
docs/source/mathematics.rst
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
mathematics module
|
||||||
|
==================
|
||||||
|
|
||||||
|
.. automodule:: mathematics
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
@@ -9,5 +9,6 @@ pylib
|
|||||||
function
|
function
|
||||||
geometry
|
geometry
|
||||||
geometry_plot
|
geometry_plot
|
||||||
|
mathematics
|
||||||
numerical
|
numerical
|
||||||
time_of_day
|
time_of_day
|
||||||
|
|||||||
17
pylib/mathematics.py
Normal file
17
pylib/mathematics.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""Mathematical functions.
|
||||||
|
|
||||||
|
:Date: 2019-10-30
|
||||||
|
|
||||||
|
.. module:: mathematics
|
||||||
|
:platform: *nix, Windows
|
||||||
|
:synopsis: Mathematical functions.
|
||||||
|
|
||||||
|
.. moduleauthor:: Daniel Weschke <daniel.weschke@directbox.de>
|
||||||
|
"""
|
||||||
|
from math import gcd
|
||||||
|
|
||||||
|
def lcm(a, b):
|
||||||
|
"""Compute the lowest common multiple of a and b"""
|
||||||
|
return a/gcd(a, b)*b
|
||||||
Reference in New Issue
Block a user