2015-04-29 08:20:44 +00:00
|
|
|
``mathutils`` - Mathematical functions
|
|
|
|
======================================
|
2015-04-18 13:41:50 +00:00
|
|
|
|
|
|
|
.. automodule:: boltons.mathutils
|
|
|
|
|
2016-11-06 07:18:44 +00:00
|
|
|
|
|
|
|
Alternative Rounding Functions
|
|
|
|
------------------------------
|
|
|
|
|
|
|
|
.. autofunction:: boltons.mathutils.clamp
|
2015-04-18 13:41:50 +00:00
|
|
|
|
2015-04-30 13:55:29 +00:00
|
|
|
.. autofunction:: boltons.mathutils.ceil
|
2015-04-18 13:41:50 +00:00
|
|
|
|
2015-04-30 13:55:29 +00:00
|
|
|
.. autofunction:: boltons.mathutils.floor
|
2015-04-27 09:16:54 +00:00
|
|
|
|
2015-04-30 13:55:29 +00:00
|
|
|
Note: :func:`ceil` and :func:`floor` functions are based on `this example`_ using from the
|
2015-04-27 09:16:54 +00:00
|
|
|
: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
|
2015-04-29 08:20:44 +00:00
|
|
|
.. _StackOverflow Answer: http://stackoverflow.com/a/12141511/811740
|