Mercurial > cpython-lru_cache-weakref
annotate Modules/_decimal/docstrings.h @ 87690:66c1c9f32567 default tip
Add use_weakref option to functools.lru_cache
The use_weakref option makes lru_cache create weak references to the function
arguments when creating the cache key, which prevents them from staying in the
memory forever even after all other references to them are gone.
This is a proof of concept for http://bugs.python.org/issue19859
| author | Radomir Dopieralski <devel@sheep.art.pl> |
|---|---|
| date | Tue, 03 Dec 2013 16:02:48 +0100 |
| parents | 29becac5dd9b |
| children |
| rev | line source |
|---|---|
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
1 /* |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
2 * Copyright (c) 2001-2012 Python Software Foundation. All Rights Reserved. |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
3 * Modified and extended by Stefan Krah. |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
4 */ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
5 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
6 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
7 #ifndef DOCSTRINGS_H |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
8 #define DOCSTRINGS_H |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
9 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
10 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
11 #include "pymacro.h" |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
12 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
13 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
14 /******************************************************************************/ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
15 /* Module */ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
16 /******************************************************************************/ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
17 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
18 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
19 PyDoc_STRVAR(doc__decimal, |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
20 "C decimal arithmetic module"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
21 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
22 PyDoc_STRVAR(doc_getcontext,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
23 getcontext() - Get the current default context.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
24 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
25 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
26 PyDoc_STRVAR(doc_setcontext,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
27 setcontext(c) - Set a new default context.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
28 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
29 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
30 PyDoc_STRVAR(doc_localcontext,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
31 localcontext(ctx=None) - Return a context manager that will set the default\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
32 context to a copy of ctx on entry to the with-statement and restore the\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
33 previous default context when exiting the with-statement. If no context is\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
34 specified, a copy of the current default context is used.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
35 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
36 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
37 #ifdef EXTRA_FUNCTIONALITY |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
38 PyDoc_STRVAR(doc_ieee_context,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
39 IEEEContext(bits) - Return a context object initialized to the proper values for\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
40 one of the IEEE interchange formats. The argument must be a multiple of 32 and\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
41 less than IEEE_CONTEXT_MAX_BITS. For the most common values, the constants\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
42 DECIMAL32, DECIMAL64 and DECIMAL128 are provided.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
43 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
44 #endif |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
45 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
46 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
47 /******************************************************************************/ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
48 /* Decimal Object and Methods */ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
49 /******************************************************************************/ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
50 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
51 PyDoc_STRVAR(doc_decimal,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
52 Decimal(value=\"0\", context=None): Construct a new Decimal object.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
53 value can be an integer, string, tuple, or another Decimal object.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
54 If no value is given, return Decimal('0'). The context does not affect\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
55 the conversion and is only passed to determine if the InvalidOperation\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
56 trap is active.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
57 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
58 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
59 PyDoc_STRVAR(doc_adjusted,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
60 adjusted() - Return the adjusted exponent of the number.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
61 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
62 Defined as exp + digits - 1.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
63 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
64 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
65 PyDoc_STRVAR(doc_as_tuple,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
66 as_tuple() - Return a tuple representation of the number.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
67 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
68 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
69 PyDoc_STRVAR(doc_canonical,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
70 canonical() - Return the canonical encoding of the argument. Currently,\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
71 the encoding of a Decimal instance is always canonical, so this operation\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
72 returns its argument unchanged.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
73 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
74 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
75 PyDoc_STRVAR(doc_compare,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
76 compare(other, context=None) - Compare self to other. Return a decimal value:\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
77 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
78 a or b is a NaN ==> Decimal('NaN')\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
79 a < b ==> Decimal('-1')\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
80 a == b ==> Decimal('0')\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
81 a > b ==> Decimal('1')\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
82 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
83 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
84 PyDoc_STRVAR(doc_compare_signal,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
85 compare_signal(other, context=None) - Identical to compare, except that\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
86 all NaNs signal.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
87 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
88 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
89 PyDoc_STRVAR(doc_compare_total,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
90 compare_total(other, context=None) - Compare two operands using their\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
91 abstract representation rather than their numerical value. Similar to the\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
92 compare() method, but the result gives a total ordering on Decimal instances.\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
93 Two Decimal instances with the same numeric value but different representations\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
94 compare unequal in this ordering:\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
95 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
96 >>> Decimal('12.0').compare_total(Decimal('12'))\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
97 Decimal('-1')\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
98 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
99 Quiet and signaling NaNs are also included in the total ordering. The result\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
100 of this function is Decimal('0') if both operands have the same representation,\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
101 Decimal('-1') if the first operand is lower in the total order than the second,\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
102 and Decimal('1') if the first operand is higher in the total order than the\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
103 second operand. See the specification for details of the total order.\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
104 \n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
105 This operation is unaffected by context and is quiet: no flags are changed\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
106 and no rounding is performed. As an exception, the C version may raise\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
107 InvalidOperation if the second operand cannot be converted exactly.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
108 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
109 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
110 PyDoc_STRVAR(doc_compare_total_mag,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
111 compare_total_mag(other, context=None) - Compare two operands using their\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
112 abstract representation rather than their value as in compare_total(), but\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
113 ignoring the sign of each operand. x.compare_total_mag(y) is equivalent to\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
114 x.copy_abs().compare_total(y.copy_abs()).\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
115 \n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
116 This operation is unaffected by context and is quiet: no flags are changed\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
117 and no rounding is performed. As an exception, the C version may raise\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
118 InvalidOperation if the second operand cannot be converted exactly.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
119 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
120 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
121 PyDoc_STRVAR(doc_conjugate,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
122 conjugate() - Return self.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
123 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
124 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
125 PyDoc_STRVAR(doc_copy_abs,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
126 copy_abs() - Return the absolute value of the argument. This operation\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
127 is unaffected by context and is quiet: no flags are changed and no rounding\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
128 is performed.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
129 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
130 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
131 PyDoc_STRVAR(doc_copy_negate,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
132 copy_negate() - Return the negation of the argument. This operation is\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
133 unaffected by context and is quiet: no flags are changed and no rounding\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
134 is performed.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
135 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
136 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
137 PyDoc_STRVAR(doc_copy_sign,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
138 copy_sign(other, context=None) - Return a copy of the first operand with\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
139 the sign set to be the same as the sign of the second operand. For example:\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
140 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
141 >>> Decimal('2.3').copy_sign(Decimal('-1.5'))\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
142 Decimal('-2.3')\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
143 \n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
144 This operation is unaffected by context and is quiet: no flags are changed\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
145 and no rounding is performed. As an exception, the C version may raise\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
146 InvalidOperation if the second operand cannot be converted exactly.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
147 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
148 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
149 PyDoc_STRVAR(doc_exp,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
150 exp(context=None) - Return the value of the (natural) exponential function\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
151 e**x at the given number. The function always uses the ROUND_HALF_EVEN mode\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
152 and the result is correctly rounded.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
153 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
154 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
155 PyDoc_STRVAR(doc_from_float,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
156 from_float(f) - Class method that converts a float to a decimal number, exactly.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
157 Since 0.1 is not exactly representable in binary floating point,\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
158 Decimal.from_float(0.1) is not the same as Decimal('0.1').\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
159 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
160 >>> Decimal.from_float(0.1)\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
161 Decimal('0.1000000000000000055511151231257827021181583404541015625')\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
162 >>> Decimal.from_float(float('nan'))\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
163 Decimal('NaN')\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
164 >>> Decimal.from_float(float('inf'))\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
165 Decimal('Infinity')\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
166 >>> Decimal.from_float(float('-inf'))\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
167 Decimal('-Infinity')\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
168 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
169 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
170 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
171 PyDoc_STRVAR(doc_fma,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
172 fma(other, third, context=None) - Fused multiply-add. Return self*other+third\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
173 with no rounding of the intermediate product self*other.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
174 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
175 >>> Decimal(2).fma(3, 5)\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
176 Decimal('11')\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
177 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
178 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
179 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
180 PyDoc_STRVAR(doc_is_canonical,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
181 is_canonical() - Return True if the argument is canonical and False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
182 Currently, a Decimal instance is always canonical, so this operation always\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
183 returns True.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
184 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
185 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
186 PyDoc_STRVAR(doc_is_finite,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
187 is_finite() - Return True if the argument is a finite number, and False if the\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
188 argument is infinite or a NaN.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
189 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
190 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
191 PyDoc_STRVAR(doc_is_infinite,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
192 is_infinite() - Return True if the argument is either positive or negative\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
193 infinity and False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
194 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
195 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
196 PyDoc_STRVAR(doc_is_nan,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
197 is_nan() - Return True if the argument is a (quiet or signaling) NaN and\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
198 False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
199 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
200 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
201 PyDoc_STRVAR(doc_is_normal,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
202 is_normal(context=None) - Return True if the argument is a normal finite\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
203 non-zero number with an adjusted exponent greater than or equal to Emin.\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
204 Return False if the argument is zero, subnormal, infinite or a NaN.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
205 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
206 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
207 PyDoc_STRVAR(doc_is_qnan,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
208 is_qnan() - Return True if the argument is a quiet NaN, and False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
209 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
210 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
211 PyDoc_STRVAR(doc_is_signed,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
212 is_signed() - Return True if the argument has a negative sign and\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
213 False otherwise. Note that both zeros and NaNs can carry signs.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
214 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
215 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
216 PyDoc_STRVAR(doc_is_snan,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
217 is_snan() - Return True if the argument is a signaling NaN and False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
218 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
219 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
220 PyDoc_STRVAR(doc_is_subnormal,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
221 is_subnormal(context=None) - Return True if the argument is subnormal, and\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
222 False otherwise. A number is subnormal if it is non-zero, finite, and has an\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
223 adjusted exponent less than Emin.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
224 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
225 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
226 PyDoc_STRVAR(doc_is_zero,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
227 is_zero() - Return True if the argument is a (positive or negative) zero and\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
228 False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
229 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
230 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
231 PyDoc_STRVAR(doc_ln,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
232 ln(context=None) - Return the natural (base e) logarithm of the operand.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
233 The function always uses the ROUND_HALF_EVEN mode and the result is\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
234 correctly rounded.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
235 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
236 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
237 PyDoc_STRVAR(doc_log10,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
238 log10(context=None) - Return the base ten logarithm of the operand.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
239 The function always uses the ROUND_HALF_EVEN mode and the result is\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
240 correctly rounded.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
241 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
242 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
243 PyDoc_STRVAR(doc_logb,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
244 logb(context=None) - For a non-zero number, return the adjusted exponent\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
245 of the operand as a Decimal instance. If the operand is a zero, then\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
246 Decimal('-Infinity') is returned and the DivisionByZero condition is\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
247 raised. If the operand is an infinity then Decimal('Infinity') is returned.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
248 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
249 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
250 PyDoc_STRVAR(doc_logical_and,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
251 logical_and(other, context=None) - Return the digit-wise and of the two\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
252 (logical) operands.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
253 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
254 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
255 PyDoc_STRVAR(doc_logical_invert,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
256 logical_invert(context=None) - Return the digit-wise inversion of the\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
257 (logical) operand.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
258 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
259 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
260 PyDoc_STRVAR(doc_logical_or,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
261 logical_or(other, context=None) - Return the digit-wise or of the two\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
262 (logical) operands.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
263 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
264 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
265 PyDoc_STRVAR(doc_logical_xor,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
266 logical_xor(other, context=None) - Return the digit-wise exclusive or of the\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
267 two (logical) operands.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
268 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
269 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
270 PyDoc_STRVAR(doc_max,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
271 max(other, context=None) - Maximum of self and other. If one operand is a\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
272 quiet NaN and the other is numeric, the numeric operand is returned.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
273 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
274 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
275 PyDoc_STRVAR(doc_max_mag,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
276 max_mag(other, context=None) - Similar to the max() method, but the\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
277 comparison is done using the absolute values of the operands.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
278 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
279 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
280 PyDoc_STRVAR(doc_min,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
281 min(other, context=None) - Minimum of self and other. If one operand is a\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
282 quiet NaN and the other is numeric, the numeric operand is returned.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
283 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
284 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
285 PyDoc_STRVAR(doc_min_mag,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
286 min_mag(other, context=None) - Similar to the min() method, but the\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
287 comparison is done using the absolute values of the operands.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
288 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
289 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
290 PyDoc_STRVAR(doc_next_minus,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
291 next_minus(context=None) - Return the largest number representable in the\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
292 given context (or in the current default context if no context is given) that\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
293 is smaller than the given operand.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
294 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
295 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
296 PyDoc_STRVAR(doc_next_plus,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
297 next_plus(context=None) - Return the smallest number representable in the\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
298 given context (or in the current default context if no context is given) that\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
299 is larger than the given operand.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
300 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
301 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
302 PyDoc_STRVAR(doc_next_toward,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
303 next_toward(other, context=None) - If the two operands are unequal, return\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
304 the number closest to the first operand in the direction of the second operand.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
305 If both operands are numerically equal, return a copy of the first operand\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
306 with the sign set to be the same as the sign of the second operand.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
307 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
308 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
309 PyDoc_STRVAR(doc_normalize,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
310 normalize(context=None) - Normalize the number by stripping the rightmost\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
311 trailing zeros and converting any result equal to Decimal('0') to Decimal('0e0').\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
312 Used for producing canonical values for members of an equivalence class. For\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
313 example, Decimal('32.100') and Decimal('0.321000e+2') both normalize to the\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
314 equivalent value Decimal('32.1').\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
315 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
316 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
317 PyDoc_STRVAR(doc_number_class,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
318 number_class(context=None) - Return a string describing the class of the\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
319 operand. The returned value is one of the following ten strings:\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
320 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
321 * '-Infinity', indicating that the operand is negative infinity.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
322 * '-Normal', indicating that the operand is a negative normal number.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
323 * '-Subnormal', indicating that the operand is negative and subnormal.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
324 * '-Zero', indicating that the operand is a negative zero.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
325 * '+Zero', indicating that the operand is a positive zero.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
326 * '+Subnormal', indicating that the operand is positive and subnormal.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
327 * '+Normal', indicating that the operand is a positive normal number.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
328 * '+Infinity', indicating that the operand is positive infinity.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
329 * 'NaN', indicating that the operand is a quiet NaN (Not a Number).\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
330 * 'sNaN', indicating that the operand is a signaling NaN.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
331 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
332 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
333 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
334 PyDoc_STRVAR(doc_quantize,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
335 quantize(exp, rounding=None, context=None) - Return a value equal to the\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
336 first operand after rounding and having the exponent of the second operand.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
337 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
338 >>> Decimal('1.41421356').quantize(Decimal('1.000'))\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
339 Decimal('1.414')\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
340 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
341 Unlike other operations, if the length of the coefficient after the quantize\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
342 operation would be greater than precision, then an InvalidOperation is signaled.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
343 This guarantees that, unless there is an error condition, the quantized exponent\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
344 is always equal to that of the right-hand operand.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
345 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
346 Also unlike other operations, quantize never signals Underflow, even if the\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
347 result is subnormal and inexact.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
348 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
349 If the exponent of the second operand is larger than that of the first, then\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
350 rounding may be necessary. In this case, the rounding mode is determined by the\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
351 rounding argument if given, else by the given context argument; if neither\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
352 argument is given, the rounding mode of the current thread's context is used.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
353 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
354 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
355 PyDoc_STRVAR(doc_radix,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
356 radix() - Return Decimal(10), the radix (base) in which the Decimal class does\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
357 all its arithmetic. Included for compatibility with the specification.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
358 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
359 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
360 PyDoc_STRVAR(doc_remainder_near,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
361 remainder_near(other, context=None) - Return the remainder from dividing\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
362 self by other. This differs from self % other in that the sign of the\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
363 remainder is chosen so as to minimize its absolute value. More precisely, the\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
364 return value is self - n * other where n is the integer nearest to the exact\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
365 value of self / other, and if two integers are equally near then the even one\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
366 is chosen.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
367 \n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
368 If the result is zero then its sign will be the sign of self.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
369 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
370 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
371 PyDoc_STRVAR(doc_rotate,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
372 rotate(other, context=None) - Return the result of rotating the digits of the\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
373 first operand by an amount specified by the second operand. The second operand\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
374 must be an integer in the range -precision through precision. The absolute\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
375 value of the second operand gives the number of places to rotate. If the second\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
376 operand is positive then rotation is to the left; otherwise rotation is to the\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
377 right. The coefficient of the first operand is padded on the left with zeros to\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
378 length precision if necessary. The sign and exponent of the first operand are\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
379 unchanged.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
380 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
381 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
382 PyDoc_STRVAR(doc_same_quantum,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
383 same_quantum(other, context=None) - Test whether self and other have the\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
384 same exponent or whether both are NaN.\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
385 \n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
386 This operation is unaffected by context and is quiet: no flags are changed\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
387 and no rounding is performed. As an exception, the C version may raise\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
388 InvalidOperation if the second operand cannot be converted exactly.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
389 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
390 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
391 PyDoc_STRVAR(doc_scaleb,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
392 scaleb(other, context=None) - Return the first operand with the exponent\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
393 adjusted the second. Equivalently, return the first operand multiplied by\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
394 10**other. The second operand must be an integer.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
395 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
396 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
397 PyDoc_STRVAR(doc_shift,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
398 shift(other, context=None) - Return the result of shifting the digits of\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
399 the first operand by an amount specified by the second operand. The second\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
400 operand must be an integer in the range -precision through precision. The\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
401 absolute value of the second operand gives the number of places to shift.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
402 If the second operand is positive, then the shift is to the left; otherwise\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
403 the shift is to the right. Digits shifted into the coefficient are zeros.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
404 The sign and exponent of the first operand are unchanged.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
405 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
406 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
407 PyDoc_STRVAR(doc_sqrt,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
408 sqrt(context=None) - Return the square root of the argument to full precision.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
409 The result is correctly rounded using the ROUND_HALF_EVEN rounding mode.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
410 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
411 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
412 PyDoc_STRVAR(doc_to_eng_string,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
413 to_eng_string(context=None) - Convert to an engineering-type string.\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
414 Engineering notation has an exponent which is a multiple of 3, so there\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
415 are up to 3 digits left of the decimal place. For example, Decimal('123E+1')\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
416 is converted to Decimal('1.23E+3').\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
417 \n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
418 The value of context.capitals determines whether the exponent sign is lower\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
419 or upper case. Otherwise, the context does not affect the operation.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
420 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
421 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
422 PyDoc_STRVAR(doc_to_integral,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
423 to_integral(rounding=None, context=None) - Identical to the\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
424 to_integral_value() method. The to_integral() name has been kept\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
425 for compatibility with older versions.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
426 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
427 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
428 PyDoc_STRVAR(doc_to_integral_exact,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
429 to_integral_exact(rounding=None, context=None) - Round to the nearest\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
430 integer, signaling Inexact or Rounded as appropriate if rounding occurs.\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
431 The rounding mode is determined by the rounding parameter if given, else\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
432 by the given context. If neither parameter is given, then the rounding mode\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
433 of the current default context is used.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
434 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
435 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
436 PyDoc_STRVAR(doc_to_integral_value,"\n\ |
|
80872
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
437 to_integral_value(rounding=None, context=None) - Round to the nearest\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
438 integer without signaling Inexact or Rounded. The rounding mode is determined\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
439 by the rounding parameter if given, else by the given context. If neither\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
440 parameter is given, then the rounding mode of the current default context is\n\ |
|
29becac5dd9b
Issue #15783: Except for the number methods, the C version of decimal now
Stefan Krah <skrah@bytereef.org>
parents:
75850
diff
changeset
|
441 used.\n\ |
|
75850
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
442 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
443 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
444 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
445 /******************************************************************************/ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
446 /* Context Object and Methods */ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
447 /******************************************************************************/ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
448 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
449 PyDoc_STRVAR(doc_context,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
450 The context affects almost all operations and controls rounding,\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
451 Over/Underflow, raising of exceptions and much more. A new context\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
452 can be constructed as follows:\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
453 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
454 >>> c = Context(prec=28, Emin=-425000000, Emax=425000000,\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
455 ... rounding=ROUND_HALF_EVEN, capitals=1, clamp=1,\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
456 ... traps=[InvalidOperation, DivisionByZero, Overflow],\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
457 ... flags=[])\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
458 >>>\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
459 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
460 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
461 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
462 #ifdef EXTRA_FUNCTIONALITY |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
463 PyDoc_STRVAR(doc_ctx_apply,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
464 apply(x) - Apply self to Decimal x.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
465 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
466 #endif |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
467 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
468 PyDoc_STRVAR(doc_ctx_clear_flags,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
469 clear_flags() - Reset all flags to False.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
470 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
471 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
472 PyDoc_STRVAR(doc_ctx_clear_traps,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
473 clear_traps() - Set all traps to False.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
474 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
475 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
476 PyDoc_STRVAR(doc_ctx_copy,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
477 copy() - Return a duplicate of the context with all flags cleared.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
478 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
479 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
480 PyDoc_STRVAR(doc_ctx_copy_decimal,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
481 copy_decimal(x) - Return a copy of Decimal x.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
482 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
483 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
484 PyDoc_STRVAR(doc_ctx_create_decimal,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
485 create_decimal(x) - Create a new Decimal instance from x, using self as the\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
486 context. Unlike the Decimal constructor, this function observes the context\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
487 limits.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
488 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
489 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
490 PyDoc_STRVAR(doc_ctx_create_decimal_from_float,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
491 create_decimal_from_float(f) - Create a new Decimal instance from float f.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
492 Unlike the Decimal.from_float() class method, this function observes the\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
493 context limits.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
494 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
495 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
496 PyDoc_STRVAR(doc_ctx_Etiny,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
497 Etiny() - Return a value equal to Emin - prec + 1, which is the minimum\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
498 exponent value for subnormal results. When underflow occurs, the exponent\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
499 is set to Etiny.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
500 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
501 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
502 PyDoc_STRVAR(doc_ctx_Etop,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
503 Etop() - Return a value equal to Emax - prec + 1. This is the maximum exponent\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
504 if the _clamp field of the context is set to 1 (IEEE clamp mode). Etop() must\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
505 not be negative.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
506 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
507 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
508 PyDoc_STRVAR(doc_ctx_abs,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
509 abs(x) - Return the absolute value of x.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
510 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
511 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
512 PyDoc_STRVAR(doc_ctx_add,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
513 add(x, y) - Return the sum of x and y.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
514 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
515 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
516 PyDoc_STRVAR(doc_ctx_canonical,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
517 canonical(x) - Return a new instance of x.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
518 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
519 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
520 PyDoc_STRVAR(doc_ctx_compare,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
521 compare(x, y) - Compare x and y numerically.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
522 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
523 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
524 PyDoc_STRVAR(doc_ctx_compare_signal,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
525 compare_signal(x, y) - Compare x and y numerically. All NaNs signal.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
526 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
527 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
528 PyDoc_STRVAR(doc_ctx_compare_total,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
529 compare_total(x, y) - Compare x and y using their abstract representation.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
530 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
531 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
532 PyDoc_STRVAR(doc_ctx_compare_total_mag,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
533 compare_total_mag(x, y) - Compare x and y using their abstract representation,\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
534 ignoring sign.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
535 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
536 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
537 PyDoc_STRVAR(doc_ctx_copy_abs,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
538 copy_abs(x) - Return a copy of x with the sign set to 0.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
539 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
540 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
541 PyDoc_STRVAR(doc_ctx_copy_negate,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
542 copy_negate(x) - Return a copy of x with the sign inverted.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
543 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
544 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
545 PyDoc_STRVAR(doc_ctx_copy_sign,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
546 copy_sign(x, y) - Copy the sign from y to x.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
547 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
548 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
549 PyDoc_STRVAR(doc_ctx_divide,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
550 divide(x, y) - Return x divided by y.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
551 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
552 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
553 PyDoc_STRVAR(doc_ctx_divide_int,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
554 divide_int(x, y) - Return x divided by y, truncated to an integer.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
555 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
556 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
557 PyDoc_STRVAR(doc_ctx_divmod,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
558 divmod(x, y) - Return quotient and remainder of the division x / y.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
559 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
560 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
561 PyDoc_STRVAR(doc_ctx_exp,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
562 exp(x) - Return e ** x.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
563 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
564 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
565 PyDoc_STRVAR(doc_ctx_fma,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
566 fma(x, y, z) - Return x multiplied by y, plus z.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
567 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
568 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
569 PyDoc_STRVAR(doc_ctx_is_canonical,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
570 is_canonical(x) - Return True if x is canonical, False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
571 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
572 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
573 PyDoc_STRVAR(doc_ctx_is_finite,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
574 is_finite(x) - Return True if x is finite, False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
575 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
576 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
577 PyDoc_STRVAR(doc_ctx_is_infinite,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
578 is_infinite(x) - Return True if x is infinite, False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
579 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
580 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
581 PyDoc_STRVAR(doc_ctx_is_nan,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
582 is_nan(x) - Return True if x is a qNaN or sNaN, False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
583 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
584 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
585 PyDoc_STRVAR(doc_ctx_is_normal,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
586 is_normal(x) - Return True if x is a normal number, False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
587 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
588 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
589 PyDoc_STRVAR(doc_ctx_is_qnan,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
590 is_qnan(x) - Return True if x is a quiet NaN, False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
591 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
592 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
593 PyDoc_STRVAR(doc_ctx_is_signed,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
594 is_signed(x) - Return True if x is negative, False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
595 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
596 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
597 PyDoc_STRVAR(doc_ctx_is_snan,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
598 is_snan() - Return True if x is a signaling NaN, False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
599 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
600 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
601 PyDoc_STRVAR(doc_ctx_is_subnormal,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
602 is_subnormal(x) - Return True if x is subnormal, False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
603 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
604 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
605 PyDoc_STRVAR(doc_ctx_is_zero,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
606 is_zero(x) - Return True if x is a zero, False otherwise.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
607 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
608 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
609 PyDoc_STRVAR(doc_ctx_ln,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
610 ln(x) - Return the natural (base e) logarithm of x.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
611 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
612 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
613 PyDoc_STRVAR(doc_ctx_log10,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
614 log10(x) - Return the base 10 logarithm of x.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
615 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
616 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
617 PyDoc_STRVAR(doc_ctx_logb,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
618 logb(x) - Return the exponent of the magnitude of the operand's MSD.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
619 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
620 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
621 PyDoc_STRVAR(doc_ctx_logical_and,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
622 logical_and(x, y) - Digit-wise and of x and y.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
623 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
624 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
625 PyDoc_STRVAR(doc_ctx_logical_invert,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
626 logical_invert(x) - Invert all digits of x.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
627 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
628 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
629 PyDoc_STRVAR(doc_ctx_logical_or,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
630 logical_or(x, y) - Digit-wise or of x and y.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
631 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
632 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
633 PyDoc_STRVAR(doc_ctx_logical_xor,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
634 logical_xor(x, y) - Digit-wise xor of x and y.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
635 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
636 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
637 PyDoc_STRVAR(doc_ctx_max,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
638 max(x, y) - Compare the values numerically and return the maximum.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
639 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
640 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
641 PyDoc_STRVAR(doc_ctx_max_mag,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
642 max_mag(x, y) - Compare the values numerically with their sign ignored.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
643 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
644 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
645 PyDoc_STRVAR(doc_ctx_min,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
646 min(x, y) - Compare the values numerically and return the minimum.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
647 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
648 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
649 PyDoc_STRVAR(doc_ctx_min_mag,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
650 min_mag(x, y) - Compare the values numerically with their sign ignored.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
651 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
652 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
653 PyDoc_STRVAR(doc_ctx_minus,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
654 minus(x) - Minus corresponds to the unary prefix minus operator in Python,\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
655 but applies the context to the result.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
656 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
657 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
658 PyDoc_STRVAR(doc_ctx_multiply,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
659 multiply(x, y) - Return the product of x and y.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
660 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
661 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
662 PyDoc_STRVAR(doc_ctx_next_minus,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
663 next_minus(x) - Return the largest representable number smaller than x.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
664 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
665 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
666 PyDoc_STRVAR(doc_ctx_next_plus,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
667 next_plus(x) - Return the smallest representable number larger than x.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
668 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
669 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
670 PyDoc_STRVAR(doc_ctx_next_toward,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
671 next_toward(x) - Return the number closest to x, in the direction towards y.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
672 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
673 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
674 PyDoc_STRVAR(doc_ctx_normalize,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
675 normalize(x) - Reduce x to its simplest form. Alias for reduce(x).\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
676 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
677 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
678 PyDoc_STRVAR(doc_ctx_number_class,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
679 number_class(x) - Return an indication of the class of x.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
680 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
681 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
682 PyDoc_STRVAR(doc_ctx_plus,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
683 plus(x) - Plus corresponds to the unary prefix plus operator in Python,\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
684 but applies the context to the result.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
685 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
686 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
687 PyDoc_STRVAR(doc_ctx_power,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
688 power(x, y) - Compute x**y. If x is negative, then y must be integral.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
689 The result will be inexact unless y is integral and the result is finite\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
690 and can be expressed exactly in 'precision' digits. In the Python version\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
691 the result is always correctly rounded, in the C version the result is\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
692 almost always correctly rounded.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
693 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
694 power(x, y, m) - Compute (x**y) % m. The following restrictions hold:\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
695 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
696 * all three arguments must be integral\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
697 * y must be nonnegative\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
698 * at least one of x or y must be nonzero\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
699 * m must be nonzero and less than 10**prec in absolute value\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
700 \n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
701 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
702 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
703 PyDoc_STRVAR(doc_ctx_quantize,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
704 quantize(x, y) - Return a value equal to x (rounded), having the exponent of y.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
705 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
706 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
707 PyDoc_STRVAR(doc_ctx_radix,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
708 radix() - Return 10.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
709 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
710 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
711 PyDoc_STRVAR(doc_ctx_remainder,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
712 remainder(x, y) - Return the remainder from integer division. The sign of\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
713 the result, if non-zero, is the same as that of the original dividend.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
714 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
715 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
716 PyDoc_STRVAR(doc_ctx_remainder_near,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
717 remainder_near(x, y) - Return x - y * n, where n is the integer nearest the\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
718 exact value of x / y (if the result is 0 then its sign will be the sign of x).\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
719 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
720 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
721 PyDoc_STRVAR(doc_ctx_rotate,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
722 rotate(x, y) - Return a copy of x, rotated by y places.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
723 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
724 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
725 PyDoc_STRVAR(doc_ctx_same_quantum,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
726 same_quantum(x, y) - Return True if the two operands have the same exponent.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
727 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
728 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
729 PyDoc_STRVAR(doc_ctx_scaleb,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
730 scaleb(x, y) - Return the first operand after adding the second value\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
731 to its exp.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
732 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
733 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
734 PyDoc_STRVAR(doc_ctx_shift,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
735 shift(x, y) - Return a copy of x, shifted by y places.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
736 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
737 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
738 PyDoc_STRVAR(doc_ctx_sqrt,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
739 sqrt(x) - Square root of a non-negative number to context precision.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
740 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
741 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
742 PyDoc_STRVAR(doc_ctx_subtract,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
743 subtract(x, y) - Return the difference between x and y.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
744 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
745 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
746 PyDoc_STRVAR(doc_ctx_to_eng_string,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
747 to_eng_string(x) - Convert a number to a string, using engineering notation.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
748 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
749 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
750 PyDoc_STRVAR(doc_ctx_to_integral,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
751 to_integral(x) - Identical to to_integral_value(x).\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
752 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
753 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
754 PyDoc_STRVAR(doc_ctx_to_integral_exact,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
755 to_integral_exact(x) - Round to an integer. Signal if the result is\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
756 rounded or inexact.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
757 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
758 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
759 PyDoc_STRVAR(doc_ctx_to_integral_value,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
760 to_integral_value(x) - Round to an integer.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
761 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
762 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
763 PyDoc_STRVAR(doc_ctx_to_sci_string,"\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
764 to_sci_string(x) - Convert a number to a string using scientific notation.\n\ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
765 \n"); |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
766 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
767 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
768 #endif /* DOCSTRINGS_H */ |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
769 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
770 |
|
7355550d5357
Issue #7652: Integrate the decimal floating point libmpdec library to speed
Stefan Krah <skrah@bytereef.org>
parents:
diff
changeset
|
771 |
