To do (or consider) =================== Deccoeff type ------------- * Add check that MAX_DIGITS/LIMB_DIGITS is small enough; twice that value should fit into a Py_ssize_t. * relax MAX_DIGITS on 64-bit platforms? * make it possible to choose LIMB_DIGITS at configure time? if so, add LIMB_DIGITS = 8 option, for purposes of experimentation. * change default choice of LIMB_DIGITS: it's probably not wise to automatically use LIMB_DIGITS = 18 when the 128-bit unsigned type is available, since LIMB_DIGITS = 9 can be faster, even on a 64-bit machine. * expand Deccoeff-specific tests * improve and correct documentation; remove outdated deccoeff.txt; ReST! * fast recursive algorithms for division, base conversion * (fast recursive) square root * implement div_nearest and sqrt_nearest: they're bottlenecks * make scale_Py_ssize_t safer: use deccoeff instead of Py_ssize_t for high-precision case * minor optimization opportunities: - in Karatsuba, accumulate all additions for middle term without propagating carry - make limb_error checks only for debug build - limbs_lshift and limbs_rshift could be faster when the shift count is a multiple of LIMB_DIGITS. - when LIMB_DIGITS == 9, base conversion could be a factor of 2 faster (asymptotically) by operating on two PyLong_Digits at a time instead of one. _Decimal type ------------- * recode the various Decimal operations in C. str and cmp are particularly high priority. C version of __str__ should write unicode directly, rather than writing bytes and then converting from bytes to unicode. * fill in missing docstrings * make exponent a Deccoeff (first requires making Deccoeff signed). this should offer improvements in parsing and printing of Decimal. OR: * make exponent a C Py_ssize_t (or long? or int64_t?), for speed. Would require some thinking about exponent and coefficient length constraints, with reference to the IBM specification. Unless there's a huge speed advantage from this, I'm more inclined to leave exponents being arbitrary precision integers. _Context type ------------- To do in its entirety.