cpython/Lib/test/decimaltestdata
Robert Smallshire 58a7da9e12
bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)
* bpo-26680: Adds support for int.is_integer() for compatibility with float.is_integer().

The int.is_integer() method always returns True.

* bpo-26680: Adds a test to ensure that False.is_integer() and True.is_integer() are always True.

* bpo-26680: Adds Real.is_integer() with a trivial implementation using conversion to int.

This default implementation is intended to reduce the workload for subclass
implementers. It is not robust in the presence of infinities or NaNs and
may have suboptimal performance for other types.

* bpo-26680: Adds Rational.is_integer which returns True if the denominator is one.

This implementation assumes the Rational is represented in it's
lowest form, as required by the class docstring.

* bpo-26680: Adds Integral.is_integer which always returns True.

* bpo-26680: Adds tests for Fraction.is_integer called as an instance method.

The tests for the Rational abstract base class use an unbound
method to sidestep the inability to directly instantiate Rational.
These tests check that everything works correct as an instance method.

* bpo-26680: Updates documentation for Real.is_integer and built-ins int and float.

The call x.is_integer() is now listed in the table of operations
which apply to all numeric types except complex, with a reference
to the full documentation for Real.is_integer().  Mention of
is_integer() has been removed from the section 'Additional Methods
on Float'.

The documentation for Real.is_integer() describes its purpose, and
mentions that it should be overridden for performance reasons, or
to handle special values like NaN.

* bpo-26680: Adds Decimal.is_integer to the Python and C implementations.

The C implementation of Decimal already implements and uses
mpd_isinteger internally, we just expose the existing function to
Python.

The Python implementation uses internal conversion to integer
using to_integral_value().

In both cases, the corresponding context methods are also
implemented.

Tests and documentation are included.

* bpo-26680: Updates the ACKS file.

* bpo-26680: NEWS entries for int, the numeric ABCs and Decimal.

Co-authored-by: Robert Smallshire <rob@sixty-north.com>
2020-10-01 17:30:08 +01:00
..
abs.decTest
add.decTest
and.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
base.decTest
clamp.decTest
class.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
compare.decTest
comparetotal.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
comparetotmag.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
copy.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
copyabs.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
copynegate.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
copysign.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddAbs.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddAdd.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddAnd.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddBase.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddCanonical.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddClass.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddCompare.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddCompareSig.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddCompareTotal.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddCompareTotalMag.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddCopy.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddCopyAbs.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddCopyNegate.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddCopySign.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddDivide.decTest Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
ddDivideInt.decTest Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
ddEncode.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddFMA.decTest Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
ddInvert.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddLogB.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddMax.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddMaxMag.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddMin.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddMinMag.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddMinus.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddMultiply.decTest Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
ddNextMinus.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddNextPlus.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddNextToward.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddOr.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddPlus.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddQuantize.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddReduce.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddRemainder.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddRemainderNear.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddRotate.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddSameQuantum.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddScaleB.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddShift.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddSubtract.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddToIntegral.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ddXor.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
decDouble.decTest
decQuad.decTest
decSingle.decTest
divide.decTest Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
divideint.decTest
dqAbs.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqAdd.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqAnd.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqBase.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqCanonical.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqClass.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqCompare.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqCompareSig.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqCompareTotal.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqCompareTotalMag.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqCopy.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqCopyAbs.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqCopyNegate.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqCopySign.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqDivide.decTest Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
dqDivideInt.decTest Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
dqEncode.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqFMA.decTest Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
dqInvert.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqLogB.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqMax.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqMaxMag.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqMin.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqMinMag.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqMinus.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqMultiply.decTest Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
dqNextMinus.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqNextPlus.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqNextToward.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqOr.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqPlus.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqQuantize.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqReduce.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqRemainder.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqRemainderNear.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqRotate.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqSameQuantum.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqScaleB.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqShift.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqSubtract.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqToIntegral.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dqXor.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dsBase.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
dsEncode.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
exp.decTest Issue #23943: Fix typos. Patch by Piotr Kasprzyk. 2015-04-14 09:30:01 +03:00
extra.decTest bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121) 2020-10-01 17:30:08 +01:00
fma.decTest Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
inexact.decTest
invert.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
ln.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
log10.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
logb.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
max.decTest
maxmag.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
min.decTest
minmag.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
minus.decTest
multiply.decTest Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
nextminus.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
nextplus.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
nexttoward.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
or.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
plus.decTest
power.decTest
powersqrt.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
quantize.decTest
randomBound32.decTest
randoms.decTest
reduce.decTest
remainder.decTest
remainderNear.decTest
rescale.decTest
rotate.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
rounding.decTest
samequantum.decTest
scaleb.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
shift.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
squareroot.decTest
subtract.decTest
testall.decTest
tointegral.decTest
tointegralx.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00
xor.decTest Add updated .hgeol file and fix newlines in the 3.1 branch. 2011-03-05 15:10:38 +01:00