Commit 56f5c383 authored by Raymond Hettinger's avatar Raymond Hettinger

Additional example of using decimal.localcontext().

parent acdc56d0
......@@ -944,6 +944,10 @@ the :func:`localcontext` function to temporarily change the active context.
s = calculate_something()
s = +s # Round the final result back to the default precision
with localcontext(BasicContext): # temporarily use the BasicContext
print Decimal(1) / Decimal(7)
print Decimal(355) / Decimal(113)
New contexts can also be created using the :class:`Context` constructor
described below. In addition, the module provides three pre-made contexts:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment