summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-04-20 17:59:20 (GMT)
committerStefan Krah <skrah@bytereef.org>2012-04-20 17:59:20 (GMT)
commit3c23a87e58ba5ba3161eaacae98a49a79e1f2786 (patch)
tree73e77dafcdbf5282aba1691f19b3f5e4bed3590e /Lib
parenta2898c1d79ed3787d51a93a9ffb7c7c695b4a46e (diff)
downloadcpython-3c23a87e58ba5ba3161eaacae98a49a79e1f2786.zip
cpython-3c23a87e58ba5ba3161eaacae98a49a79e1f2786.tar.gz
cpython-3c23a87e58ba5ba3161eaacae98a49a79e1f2786.tar.bz2
The divmod function for large numbers now has an ACL2 proof. Related changes:
1) Rename _mpd_qbarrett_divmod into _mpd_base_ndivmod: The function is only marginally related to either Barrett's algorithm or to the version in Hasselstrom's paper. 2) In places where the proof assumes exact operations, use new versions of add/sub/multiply that set NaN/Invalid_operation if this condition is not met. According to the proof this cannot happen, so this should be regarded as an extra safety net. 3) Raise Division_impossible for operands with a number of digits greater than MPD_MAX_PREC. This facilitates the audit of the function and can practically only occur in the 32-bit version under conditions where a MemoryError is already imminent. 4) Use _mpd_qmul() in places where the result can exceed MPD_MAX_PREC in a well defined manner. 5) Test for mpd_isspecial(qq) in a place where the addition of one can theoretically trigger a Malloc_error. 6) Remove redundant code in _mpd_qdivmod(). 7) Add many comments.
Diffstat (limited to 'Lib')
0 files changed, 0 insertions, 0 deletions