File: contexts.rst

package info (click to toggle)
python-gmpy2 2.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,996 kB
  • sloc: ansic: 24,604; python: 4,911; makefile: 123
file content (27 lines) | stat: -rw-r--r-- 778 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
22
23
24
25
26
27
.. _contexts:

Contexts
========

.. currentmodule:: gmpy2

`context()` creates a new context.  `set_context()` will set the active
context.  `get_context()` will return a reference to the active context.  Note
that contexts are mutable: modifying the reference returned by `get_context()`
will modify the active context until a new context is enabled with
`set_context()`.  The `context.copy()` method will return a copy of the
context.  Contexts that implement the standard *single*, *double*, and
*quadruple* precision floating point types can be created using `ieee()`.

Context Type
------------

.. autoclass:: context

Context Functions
-----------------

.. autofunction:: get_context
.. autofunction:: ieee
.. autofunction:: local_context
.. autofunction:: set_context