File: mathutils.rst

package info (click to toggle)
python-boltons 18.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,104 kB
  • sloc: python: 10,216; makefile: 159
file content (21 lines) | stat: -rw-r--r-- 713 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
``mathutils`` - Mathematical functions
======================================

.. automodule:: boltons.mathutils


Alternative Rounding Functions
------------------------------

.. autofunction:: boltons.mathutils.clamp

.. autofunction:: boltons.mathutils.ceil

.. autofunction:: boltons.mathutils.floor

Note: :func:`ceil` and :func:`floor` functions are based on `this example`_ using from the
:mod:`bisect` module in the standard library. Refer to this `StackOverflow Answer`_ for further information regarding
the performance impact of this approach.

.. _this example: https://docs.python.org/3/library/bisect.html#searching-sorted-lists
.. _StackOverflow Answer: http://stackoverflow.com/a/12141511/811740