Stefan Krah
2fdf4e7b9b
Move PyErr_NoMemory() closer to the failure.
12 years ago
Stefan Krah
f35b0274f9
Move PyErr_NoMemory() closer to the failure.
12 years ago
Stefan Krah
a0fd1f5a18
Change style to match the surrounding code (no early returns).
12 years ago
Stefan Krah
5ec6be9b50
Change style to match the surrounding code (no early returns).
12 years ago
Victor Stinner
ac470854b8
Issue #19437 : Fix dec_format() of the _decimal module, handle dec_strdup()
failure (memory allocation failure): raise a MemoryError exception
12 years ago
Victor Stinner
34f7383d7a
Issue #19437 : Fix dec_format() of the _decimal module, handle dec_strdup()
failure (memory allocation failure): raise a MemoryError exception
12 years ago
Victor Stinner
a992e11fe3
Issue #19437 : Fix convert_op_cmp() of decimal.Decimal rich comparator, handle
PyObject_IsInstance() failure
12 years ago
Victor Stinner
1ce3f840be
Issue #19437 : Fix convert_op_cmp() of decimal.Decimal rich comparator, handle
PyObject_IsInstance() failure
12 years ago
Stefan Krah
04754b0fd4
Support multiarch build in tests.
13 years ago
Stefan Krah
891ca9e06a
Backport bff16086f03b and bcaaaa00425b.
13 years ago
Stefan Krah
6edda14b29
Issue #17768 : Support newline fill character in decimal.py and NUL fill
character in _decimal.c.
13 years ago
Stefan Krah
a0547b8ac4
Mark untestable lines for gcov.
13 years ago
Ezio Melotti
3f5db3940f
Fix a few typos and a double semicolon. Patch by Eitan Adler.
13 years ago
Stefan Krah
eb8c451bd2
Since the return type of format() is not a Decimal, raise ValueError instead of
InvalidOperation if the format specification (width, prec) exceeds the internal
limits of libmpdec.
13 years ago
Stefan Krah
752bfb71d8
Remove trailing whitespace.
13 years ago
Stefan Krah
59a4a93f43
Issue #16422 : Use strings for rounding mode constants for better readability
and pickling compatibility.
13 years ago
Stefan Krah
e3dff55a5e
Issue #16753 : Define __GNUC_STDC_INLINE__ to an integer (same as gcc).
13 years ago
Stefan Krah
f03eee12b4
Issue #16745 : The gcc visibility pragma is buggy on OpenIndiana and NetBSD.
13 years ago
Stefan Krah
66a6f3fa81
Fix Visual Studio build.
13 years ago
Stefan Krah
fdf1a34ba1
Issue #16745 : Hide symbols in _decimal.so.
13 years ago
Stefan Krah
fb7f580e81
Issue #16745 : Hide a couple of symbols by making them local.
13 years ago
Stefan Krah
9a4ff437d1
Issue #15783 : Support None default values in the Context() constructor.
13 years ago
Stefan Krah
040e311826
Issue #15783 : Except for the number methods, the C version of decimal now
supports all None default values present in decimal.py. These values were
largely undocumented.
13 years ago
Stefan Krah
6e467049c6
Accept Unicode legacy strings in the Decimal constructor.
13 years ago
Stefan Krah
0f82b76b57
Issue #16431 : Finally, consider all permutations.
13 years ago
Stefan Krah
ed16eff57e
Issue #16431 : Also fix the opposite direction.
13 years ago
Stefan Krah
f4abc7b8a0
Issue #16431 : Use the type information when constructing a Decimal subtype
from a Decimal argument.
13 years ago
Stefan Krah
a0346e56ac
Support gcc's -ansi flag: use "__asm__" instead of "asm".
14 years ago
Stefan Krah
e59aa8c94d
Revert 29506c7db353 (build output should be accurate).
14 years ago
Christian Heimes
72c9946718
Change libmpdec to use ANSI code in strict ansi mode as inline asm isn't supported in ANSI C
14 years ago
Stefan Krah
9a3f05e60f
Make it clear that the pi function is modified for benchmarking purposes.
14 years ago
Stefan Krah
6b6a1df996
Restore the benchmark order to avoid waiting for decimal.py if just the
prec=9 test is used.
14 years ago
Brett Cannon
6cf50c5b1d
Fix whitespace.
14 years ago
Brett Cannon
63092fe0ea
Fix whitespace.
14 years ago
Brett Cannon
d266c4451f
Make the decimal bench file run under Python 2.7.
14 years ago
Stefan Krah
7e6523fbd7
Use C-style comments.
14 years ago
Stefan Krah
f817a7b178
Use C-style comments.
14 years ago
Stefan Krah
76e12179c5
Issue #15882 : Change _decimal to accept any coefficient tuple when
constructing infinities. This is done for backwards compatibility
with decimal.py: Infinity coefficients are undefined in _decimal
(in accordance with the specification).
14 years ago
Stefan Krah
dbcf103be0
Issue #15882 : Change _decimal to accept any coefficient tuple when
constructing infinities. This is done for backwards compatibility
with decimal.py: Infinity coefficients are undefined in _decimal
(in accordance with the specification).
14 years ago
Mark Dickinson
fc33d4ce0a
Issue #15544 : Fix Decimal.__float__ to work with payload-carrying NaNs.
14 years ago
Stefan Krah
f21587e3a8
mpd_qpowmod(): calculate result with zero-exponent for compatibility with
decimal.py. The hack to remove the ideal exponent is no longer required.
14 years ago
Stefan Krah
17183a2972
Use zero bottom margin.
14 years ago
Stefan Krah
ad5b43995e
In the 32-bit build, dec_hash() raised InvalidOperation if the operand
had a coefficient with MAX_PREC=425000000 digits and a negative exponent.
Increasing the context limits above the official values fixes the issue
and is safe (in this case!).
14 years ago
Stefan Krah
2fd502f6a1
1) Use _mpd_basedivmod() regardless of the length of the dividend. This is
required for a corner case in dec_hash() in the following commit and also
usually faster. dec_hash() needs some extra precision above MPD_MAX_PREC,
and _mpd_base_ndivmod() is not audited for that.
2) Use _mpd_basemul() if the length of the smaller operand is less than
or equal to 256. While this is technically an optimization, it is
required for *testing* corner cases in dec_hash() in reasonable time.
14 years ago
Stefan Krah
b9e36b97f2
Add unused parameter to a couple of METH_NOARGS functions. The previous
form is used in many places in the source tree, but was found to be incorrect
in a recent tracker discussion.
14 years ago
Stefan Krah
26a1c7a905
Fix Visual Studio warning.
14 years ago
Stefan Krah
e574402bd6
Issue #7652 : Clean up _mpd_qinvroot() and mark it LIBMPDEC_ONLY. Use the
algorithm from decimal.py for mpd_qsqrt().
14 years ago
Stefan Krah
d57caf36bd
Remove ISSUES.txt.
14 years ago
Stefan Krah
5431e30853
After 79d2eb29c755 it is no longer necessary to zero the output array:
None of the _mpd_shortadd() or _mpd_shortmul() functions read uninitialized
values. Previously zeroing was required since _mpd_real_size() was called
on the output array.
14 years ago
Stefan Krah
c35a8e5c98
Proactive reliability fix for broken FPUs: The base conversion functions
use log10() to calculate the size of the output array. The current code
has been tested on x86/amd64 (and to a lesser extent on qemu-mips qemu-sparc)
and produces sufficiently large values for all inputs tested so far (coefficient
sizes of 10**18 - 1 are hard to test exhaustively).
The new code does not rely on the correctness of log10() and resizes
the output arrays if the allocated space is insufficient.
14 years ago