Bugs item #1388949, was opened at 2005-12-23 12:11 Message generated for change (Settings changed) made by facundobatista You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1388949&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Adam Olsen (rhamphoryncus) >Assigned to: Facundo Batista (facundobatista) Summary: Decimal sqrt() ignores rounding Initial Comment: Decimal Contexts' sqrt() method exhibits the same rounding behavior irregardless of the rounding parameter. >>> c = decimal.Context(rounding=decimal.ROUND_CEILING) >>> f = decimal.Context(rounding=decimal.ROUND_FLOOR) >>> cs = decimal.Context(rounding=decimal.ROUND_CEILING, prec=14) >>> fs = decimal.Context(rounding=decimal.ROUND_FLOOR, prec=14) >>> c.sqrt(D(2)) Decimal("1.414213562373095048801688724") >>> f.sqrt(D(2)) Decimal("1.414213562373095048801688724") >>> cs.sqrt(D(2)) Decimal("1.4142135623731") >>> fs.sqrt(D(2)) Decimal("1.4142135623731") It appears to always round up. Python 2.4.2 (#2, Nov 20 2005, 17:04:48) Debian unstable ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1388949&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com