[Python-checkins] python/dist/src/Lib decimal.py,NONE,1.1
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Thu Jul 1 07:01:33 EDT 2004
- Previous message: [Python-checkins] python/dist/src/Lib/test/decimaltestdata - New
directory
- Next message: [Python-checkins] python/dist/src/Lib/test/decimaltestdata
abs.decTest, NONE, 1.1 add.decTest, NONE, 1.1 base.decTest,
NONE, 1.1 clamp.decTest, NONE, 1.1 compare.decTest, NONE,
1.1 decimal64.decTest, NONE, 1.1 divide.decTest, NONE,
1.1 divideint.decTest, NONE, 1.1 inexact.decTest, NONE,
1.1 integer.decTest, NONE, 1.1 max.decTest, NONE,
1.1 min.decTest, NONE, 1.1 minus.decTest, NONE,
1.1 multiply.decTest, NONE, 1.1 normalize.decTest, NONE,
1.1 plus.decTest, NONE, 1.1 power.decTest, NONE,
1.1 quantize.decTest, NONE, 1.1 randomBound32.decTest, NONE,
1.1 randoms.decTest, NONE, 1.1 remainder.decTest, NONE,
1.1 remainderNear.decTest, NONE, 1.1 rescale.decTest, NONE,
1.1 rounding.decTest, NONE, 1.1 samequantum.decTest, NONE,
1.1 squareroot.decTest, NONE, 1.1 subtract.decTest, NONE,
1.1 testall.decTest, NONE, 1.1 tointegral.decTest, NONE,
1.1 trim.decTest, NONE, 1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26988/Lib
Added Files:
decimal.py
Log Message:
Move Decimal from the sandbox into production.
--- NEW FILE: decimal.py ---
# Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
# Todo:
# Add deepcopy and pickle support for contexts
# Consider having a SimpleDecimal subclass implementing X3.274 semantics
# Improve the Context API
# Especially with respect to setting flags and traps
# Consider adding a clear_flags() method to Context
# Provide a clean way of attaching monetary format representations
# Review all exposed constants for utility vs. namespace clutter
[...3046 lines suppressed...]
mantissa = intpart + fracpart
tmp = map(int, mantissa)
backup = tmp
while tmp and tmp[0] == 0:
del tmp[0]
# It's a zero
if not tmp:
if backup:
return (sign, tuple(backup), exp)
return (sign, (0,), exp)
mantissa = tuple(tmp)
return (sign, mantissa, exp)
if __name__ == '__main__':
import doctest, sys
doctest.testmod(sys.modules[__name__])
- Previous message: [Python-checkins] python/dist/src/Lib/test/decimaltestdata - New
directory
- Next message: [Python-checkins] python/dist/src/Lib/test/decimaltestdata
abs.decTest, NONE, 1.1 add.decTest, NONE, 1.1 base.decTest,
NONE, 1.1 clamp.decTest, NONE, 1.1 compare.decTest, NONE,
1.1 decimal64.decTest, NONE, 1.1 divide.decTest, NONE,
1.1 divideint.decTest, NONE, 1.1 inexact.decTest, NONE,
1.1 integer.decTest, NONE, 1.1 max.decTest, NONE,
1.1 min.decTest, NONE, 1.1 minus.decTest, NONE,
1.1 multiply.decTest, NONE, 1.1 normalize.decTest, NONE,
1.1 plus.decTest, NONE, 1.1 power.decTest, NONE,
1.1 quantize.decTest, NONE, 1.1 randomBound32.decTest, NONE,
1.1 randoms.decTest, NONE, 1.1 remainder.decTest, NONE,
1.1 remainderNear.decTest, NONE, 1.1 rescale.decTest, NONE,
1.1 rounding.decTest, NONE, 1.1 samequantum.decTest, NONE,
1.1 squareroot.decTest, NONE, 1.1 subtract.decTest, NONE,
1.1 testall.decTest, NONE, 1.1 tointegral.decTest, NONE,
1.1 trim.decTest, NONE, 1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Python-checkins
mailing list