[Python-checkins] python/dist/src/Lib decimal.py,1.17,1.18

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Wed Jul 14 21:56:59 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24915

Modified Files:
	decimal.py 
Log Message:
Factor out two unnecessary global variables.

Index: decimal.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/decimal.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** decimal.py	14 Jul 2004 16:35:29 -0000	1.17
--- decimal.py	14 Jul 2004 19:56:56 -0000	1.18
***************
*** 130,137 ****
  import operator
  
- #Exponent Range
- DEFAULT_MAX_EXPONENT = 999999999
- DEFAULT_MIN_EXPONENT = -999999999
- 
  #Rounding
  ROUND_DOWN = 'ROUND_DOWN'
--- 130,133 ----
***************
*** 1700,1704 ****
          firstprec = context.prec
  
!         if not modulo and firstprec + elength + 1 > DEFAULT_MAX_EXPONENT:
              return context._raise_error(Overflow, 'Too much precision.', sign)
  
--- 1696,1700 ----
          firstprec = context.prec
  
!         if not modulo and firstprec + elength + 1 > DefaultContext.Emax:
              return context._raise_error(Overflow, 'Too much precision.', sign)
  
***************
*** 1923,1928 ****
  
          Emax, Emin = context.Emax, context.Emin
!         context.Emax, context.Emin = DEFAULT_MAX_EXPONENT, DEFAULT_MIN_EXPONENT
! 
  
          half = Decimal('0.5')
--- 1919,1923 ----
  
          Emax, Emin = context.Emax, context.Emin
!         context.Emax, context.Emin = DefaultContext.Emax, DefaultContext.Emin
  
          half = Decimal('0.5')
***************
*** 2948,2953 ****
          flags=[],
          _rounding_decision=ALWAYS_ROUND,
!         Emax=DEFAULT_MAX_EXPONENT,
!         Emin=DEFAULT_MIN_EXPONENT,
          capitals=1
  )
--- 2943,2948 ----
          flags=[],
          _rounding_decision=ALWAYS_ROUND,
!         Emax=999999999,
!         Emin=-999999999,
          capitals=1
  )
***************
*** 2962,2966 ****
          traps=[DivisionByZero, Overflow, InvalidOperation, Clamped, Underflow],
          flags=[],
-         _rounding_decision=ALWAYS_ROUND,
  )
  
--- 2957,2960 ----
***************
*** 2969,2973 ****
          traps=[],
          flags=[],
-         _rounding_decision=ALWAYS_ROUND,
  )
  
--- 2963,2966 ----



More information about the Python-checkins mailing list