[Python-checkins] python/dist/src/Doc/ref ref5.tex,1.66,1.67

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Thu, 07 Nov 2002 21:30:25 -0800


Update of /cvsroot/python/python/dist/src/Doc/ref
In directory usw-pr-cvs1:/tmp/cvs-serv18317

Modified Files:
	ref5.tex 
Log Message:
Closes SF bug #634069 reporting the docs on the ** operator were out
of date and did not reflect the current CPython implementation.



Index: ref5.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** ref5.tex	11 Oct 2002 21:08:02 -0000	1.66
--- ref5.tex	8 Nov 2002 05:30:23 -0000	1.67
***************
*** 600,607 ****
  its left argument raised to the power of its right argument.  The
  numeric arguments are first converted to a common type.  The result
! type is that of the arguments after coercion; if the result is not
! expressible in that type (as in raising an integer to a negative
! power, or a negative floating point number to a broken power), a
! \exception{TypeError} exception is raised.
  
  
--- 600,617 ----
  its left argument raised to the power of its right argument.  The
  numeric arguments are first converted to a common type.  The result
! type is that of the arguments after coercion.
! 
! With mixed operand types, the coercion rules for binary arithmetic
! operators apply. For int and long int operands, the result has the
! same type as the operands (after coercion) unless the second argument
! is negative; in that case, all arguments are converted to float and a
! float result is delivered. For example, \code{10**2} returns \code{100},
! but \code{10**-2} returns \code{0.01}. (This last feature was added in
! Python 2.2. In Python 2.1 and before, if both arguments were of integer
! types and the second argument was negative, an exception was raised).
! 
! Raising \code{0.0} to a negative power results in a
! \exception{ZeroDivisionError}.  Raising a negative number to a
! fractional power results in a \exception{ValueError}.