[Python-Dev] Expert floats (original) (raw)
Andrew Koenig ark-mlist at att.net
Wed Mar 31 15:59:12 EST 2004
- Previous message: [Python-Dev] Expert floats
- Next message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
import Decimal d1 = Decimal.Decimal('1E50') d2 = Decimal.Decimal('1E-50') d1 + d2 Decimal( (0, (1, 0, 0, 0, 0, 0, 0, 0, 0), 42L) ) d1 + d2 == d1 True Decimal.getcontext().prec = 1000 d1 + d2 == d1 False d1 + d2 Decimal( (0, (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), -50L) )
Very nice!
- Previous message: [Python-Dev] Expert floats
- Next message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]